<?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::table('operate_stock_logs', function (Blueprint $table) {
            $table->tinyInteger('goods_type')->default(1)->comment('商品类型 0:商品 1:营养品')->after('user_id');
            $table->tinyInteger('sku_id')->nullable()->comment('sku id')->after('user_id');
            $table->tinyInteger('status')->default(1)->comment('审核状态:0未审核 1:审核通过 2:审核拒绝')->after('user_id');
            $table->string('contract_id')->nullable()->comment('合同id')->after('order_id');
            $table->string('images')->nullable()->comment('照片')->after('order_id');
            $table->string('check_name')->nullable()->comment('审核人')->after('order_id');
            $table->string('check_user_id')->nullable()->comment('审核人用户id')->after('order_id');
            $table->string('check_remark')->nullable()->comment('审核建议')->after('order_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('operate_stock_logs', function (Blueprint $table) {
            $table->dropColumn('contract_id');
            $table->dropColumn('images');
            $table->dropColumn('status');
            $table->dropColumn('check_name');
            $table->dropColumn('check_user_id');
            $table->dropColumn('check_remark');
        });
    }
};
