<?php

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

class CreateTransactionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('transactions', function (Blueprint $table) {
            $table->increments('id');
            $table->enum('status', ['Unapprove','Approve','Reject','Reversal'])->default('Unapprove');
            $table->string('old_voucher')->nullable();
            
            $table->string('voucher_number',25)->nullable();
            $table->string('voucher_type',25)->nullable();
            $table->enum('compound_type', ['General','Multiple Debit','Multiple Credit'])->nullable();
            $table->double('total_amount')->nullable();
            $table->timestamp('clearence_date')->nullable();            
            $table->enum('is_usable', ['0','1'])->default('0');
            $table->enum('is_recycle', ['0','1','2'])->default('0');
            $table->timestamps();
        });
    }

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