%PDF- %PDF-
Direktori : /var/www/html/hr/api/database/migrations/ |
Current File : /var/www/html/hr/api/database/migrations/2020_04_01_150056_create_annual_leaves_table.php |
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAnnualLeavesTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('annual_leaves', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('user_id') ->index(); $table->foreign('user_id') ->references('id') ->on('users'); $table->decimal('quantity', 4, 2); $table->timestamps(); }); Schema::create('annual_leave_transactions', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('annual_leave_id') ->index(); $table->foreign('annual_leave_id') ->references('id') ->on('annual_leaves'); $table->string('type'); $table->decimal('quantity', 4, 2); $table->string('notes') ->nullable(); $table->date('expires_at') ->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('annual_leave_transactions'); Schema::dropIfExists('annual_leaves'); } }