<?php

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

class CreateBixoAccountAllocationsTable extends Migration
{
    /*
     * Run the migrations.
     *
     * @return void
     */

    public function up()
    {

        /*
         * Table: bixo_account_allocations
         */
        Schema::create('bixo_account_allocations', function ($table) {
            $table->increments('id');
            $table->date('date')->nullable();
            $table->enum('type', ['Yes', 'No'])->nullable();
            $table->integer('allocatable_id')->nullable();
            $table->string('allocatable_type', 50)->nullable();
            $table->integer('customer_id')->nullable();
            $table->string('customer_name', 50)->nullable();
            $table->integer('coa_id')->nullable();
            $table->string('coa_name', 50)->nullable();
            $table->decimal('payment', 12,3)->nullable();
            $table->decimal('receipt', 12,3)->nullable();
            $table->string('allo_tranTypeName', 50)->nullable();
            $table->integer('allo_tranDocID')->nullable();
            $table->package::package.fieldtype.doc('Journal')->nullable();
            $table->string('doc_code', 50)->nullable();
            $table->package::package.fieldtype.doc('Journal')->nullable();
            $table->date('doc_date')->nullable();
            $table->package::package.fieldtype.doc('Journal')->nullable();
            $table->decimal('doc_amount', 12,3)->nullable();
            $table->package::package.fieldtype.doc('Journal')->nullable();
            $table->decimal('allo_tranAlloOutstanding', 20,8)->nullable();
            $table->enum('status', ['Yes', 'No'])->nullable();
            $table->text('marking', 200)->nullable();
            $table->softDeletes();
            $table->nullableTimestamps();
        });
    }

    /*
    * Reverse the migrations.
    *
    * @return void
    */

    public function down()
    {
        Schema::drop('bixo_account_allocations');
    }
}