<?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('quest_reward_log', function (Blueprint $table) {
            $table->string('quest_name', 32)->nullable();
            $table->unsignedInteger('player_id');
            $table->tinyInteger('player_level');
            $table->enum('reward_type', ['EXP', 'ITEM'])->nullable();
            $table->unsignedInteger('reward_value1');
            $table->integer('reward_value2');
            $table->dateTime('time')->nullable();

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

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