<?php

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

class CreateInvoiceTransactionsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('invoice_transactions', function(Blueprint $table)
		{
			$table->increments('id');
			$table->unsignedBigInteger('invoice_id');
			$table->float('amount')->default(0);
			$table->enum('method_of_payment', array('card', 'cash', 'cheque'))->default('card');
			$table->unsignedBigInteger('created_by');
			$table->unsignedBigInteger('updated_by');
			$table->timestamps();
		});
	}

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

}
