<?php

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

class SaveValueStoreDataDate extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        \App\ValueStore::query()->firstOrCreate(["name"=>"wave_last_sync_date"]);
        Schema::table("batches",function (Blueprint $table){
            $table->string("remark")->nullable()->comment("中文描述");
            $table->string("owner_id")->index()->nullable()->comment("外键货主");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        \App\ValueStore::query()->where("name","wave_last_sync_date")->delete();
        Schema::table("batches",function (Blueprint $table){
            $table->dropColumn("remark");
            $table->dropColumn("owner_id");
        });
    }
}
