<?php

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

class CreateSaleTransactionsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('sale_transactions', function(Blueprint $table)
		{
			$table->increments('id');
			$table->unsignedBigInteger('sale_id');
			$table->float('amount')->default(0);
			$table->enum('type', array('debit', 'refund', 'credit'))->default('debit');
			$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('sale_transactions');
	}

}
