<?php

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

class CreateOrdersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('orders', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('state')->default(1); //1.pending 2.working 3.done 4.deliverd 5.returned 6.canceld
            $table->text('notice')->nullable();
            $table->unsignedInteger('proccess_type'); // 1 hdwc, 2.swc, 3.hdwc&swc 4.swc&hdwc 5.mob
            $table->unsignedInteger('cost')->default(0);
            $table->unsignedInteger('discount')->default(0);
            $table->boolean('isVisible')->default(true);
            $table->unsignedInteger('priority')->nullable();
            $table->unsignedBigInteger('created_employee');
            $table->unsignedBigInteger('updated_employee');
            $table->timestamps();

        });
    }

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