<?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('change_name', function (Blueprint $table) {
            $table->unsignedInteger('pid');
            $table->string('old_name')->nullable();
            $table->string('new_name')->nullable();
            $table->dateTime('time')->nullable();
            $table->string('ip', 20)->nullable();

            $table->foreign('pid')->references('id')->on('player');
        });
    }

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