<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('hack_log', function (Blueprint $table) {
            $table->dateTime('time')->useCurrent();
            $table->string('login', 30);
            $table->string('name', 24);
            $table->string('ip', 15);
            $table->string('server', 100);
            $table->string('why')->default('');

            $table->foreign('login')->references('login')->on('account');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('hack_log');
    }
};
