CasperSecurity
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateManageLeavesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('manage_leaves', function (Blueprint $table) {
$table->id();
$table->foreignId('employee_no')->constrained('employee_registrations')->cascadeOnDelete();
$table->foreignId('leave_type_id')->constrained('leave_types');
$table->date('from_date');
$table->date('to_date');
$table->string('half_day')->nullable();
$table->decimal('duration',10,2);
$table->string('leave_reason');
$table->tinyInteger('status')->default('1');
$table->string('created_by')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('manage_leaves');
}
}