<?php

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

class ChangeProcessContentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('processes_additional_bills');
        Schema::create('processes_contents', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('process_id')->index()->comment('外键二次加工单');
            $table->enum('bill_type',['移库单','入库单','出库单'])->comment('单据类型');
            $table->bigInteger('commodity_id')->comment('外键商品');
            $table->string('wms_code')->index()->comment('单据号');
            $table->integer('amount')->comment('数量');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('processes_contents');
        Schema::create('processes_additional_bills', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('process_id')->index()->comment('外键二次加工单');
            $table->string('wms_code')->index()->comment('单据号');
            $table->enum('bill_type',['入库单'])->default('入库单')->comment('单据类型');
            $table->integer('amount')->comment('数量');
            $table->timestamps();
        });
    }
}
