<?php

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

class CreateCustomerRelationTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('customer_relation', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('forwarder_id');
            $table->integer('company_id');
            $table->smallInteger('type', false, false);
            $table->decimal('customer_rate', 13, 3)->default(0);
            $table->decimal('credit_limit', 13, 3);
            $table->integer('term_limit')->default(0);
            $table->boolean('wave_minimum')->default(0);
            $table->timestamps();
        });
    }

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