<?php

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

class CreateWorkHourManagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('work_hour_manages', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('storeowner_id')->nullable();
            $table->unsignedBigInteger('store_detail_id')->nullable();
            $table->string('day')->nullable();
            $table->tinyInteger('status')->nullable()->default('0');
            $table->Time('start_time')->nullable();
            $table->Time('end_time')->nullable();
            $table->foreign('storeowner_id')->references('id')->on('users')->onDelete('cascade');
            $table->foreign('store_detail_id')->references('id')->on('stores')->onDelete('cascade');
            $table->timestamps();
        });
    }

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