File "2015_05_23_063217_create_payrolls_table.php"

Full Path: /home/isoftco/public_html/hrm/database/migrations/2015_05_23_063217_create_payrolls_table.php
File size: 1.14 KB
MIME-type: text/x-php
Charset: utf-8

<?php

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

class CreatePayrollsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('payrolls', function(Blueprint $table)
		{
			$table->increments('id');
			$table->unsignedInteger("employee_id");
			
			$table->foreign('employee_id')
			      ->references('id')->on('employees')
			      ->onUpdate('cascade')
			      ->onDelete('cascade');
			$table->string('month');
			$table->string('year');
			$table->enum('payment_mode',['cash','paypal','bank_transfer','cheque']);
			$table->string('basic');
			$table->string('overtime_hours');
			$table->string('overtime_pay');

			$table->string('allowances');
			$table->string('total_allowance');

			$table->string('deductions');
			$table->string('total_deduction');

			$table->string('additionals');
			$table->string('total_additional');
			$table->string('net_salary');
			$table->date('pay_date');
			$table->timestamps();
		});
	}


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

}