File "2015_01_15_104831_create_employee_documents_table.php"

Full Path: /home/isoftco/public_html/hrm/database/migrations/2015_01_15_104831_create_employee_documents_table.php
File size: 771 bytes
MIME-type: text/x-php
Charset: utf-8

<?php

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

class CreateEmployeeDocumentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('employee_documents', function(Blueprint $table)
		{
			$table->increments('id');


			$table->unsignedInteger("employee_id");
			
			$table->foreign('employee_id')
      			  ->references('id')->on('employees')
      			  ->onUpdate('cascade')
      			  ->onDelete('cascade');
      		$table->string('type',100);
      		$table->string('filename',100);


			$table->timestamps();
		});
	}

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

}