File "2015_01_02_113252_create_designation_table.php"

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

<?php

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

class CreateDesignationTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('designation', function(Blueprint $table)
		{
			$table->increments('id');			
			$table->unsignedInteger('department_id');
			
			$table->foreign('department_id')
      			  ->references('id')->on('department')
      			  ->onUpdate('cascade')
      			  ->onDelete('cascade');

      		$table->string('designation',100);
			$table->timestamps();
		});
	}

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

}