<?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('fish_log', function (Blueprint $table) {
            $table->dateTime('time')->useCurrent();
            $table->unsignedInteger('player_id');
            $table->tinyInteger('map_index')->default(0);
            $table->unsignedInteger('fish_id')->index('fish_id');
            $table->integer('fishing_level');
            $table->integer('waiting_time');
            $table->boolean('success')->default(false);
            $table->smallInteger('size')->default(0);

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

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