<?php

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

class CreateLocationCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('location_comments', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('material_id');
            $table->text('comment')->nullable();
            $table->string('others')->nullable();
            $table->foreign('material_id')->references('id')->on('stock_take_materials');
            $table->timestamps();
        });
    }

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