File "2015_01_15_110029_create_holidays_table.php"
Full Path: /home/isoftco/public_html/hrm/database/migrations/2015_01_15_110029_create_holidays_table.php
File size: 766 bytes
MIME-type: text/x-php
Charset: utf-8
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateHolidaysTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('holidays', function(Blueprint $table)
{
$table->increments('id');
$table->unsignedInteger('company_id')->nullable();
$table->foreign('company_id')
->references('id')->on('companies')
->onUpdate('cascade')
->onDelete('cascade');
$table->date('date');
$table->unique(['date','company_id']);
$table->string('occassion',100);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('holidays');
}
}