<?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->foreignId('company_module_id');
            $table->string('reference');
            $table->string('reference_contract')->nullable();
            $table->integer('type')->default(0)->comment('Order packages can be shipped in shared or dedicated container');
            $table->integer('status')->default(0)->comment('Status of this order, e.g. processing, shipping etc.');
            $table->softDeletes();
            $table->timestamps();
        });
    }

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