<?php

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

class AddReissueNumToDailyStockRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (Schema::hasColumn('daily_stock_records', 'reissue_num')) {
            return;
        }
        Schema::table('daily_stock_records', function (Blueprint $table) {
            $table->unsignedInteger('reissue_num')->default(0)->comment('补发数量');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('daily_stock_records', function (Blueprint $table) {
            $table->dropColumn('reissue_num');
        });
    }
}
