%PDF- %PDF-
Direktori : /var/www/html/hr/api/database/migrations/ |
Current File : /var/www/html/hr/api/database/migrations/2020_03_22_112156_create_ptos_table.php |
<?php use App\Models\Pto; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePtosTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('ptos', function (Blueprint $table) { $table->id(); $table->date('start_date'); $table->date('end_date'); $table->string('status') ->default(Pto::DRAFT); $table->text('notes') ->nullable(); $table->unsignedBigInteger('user_id') ->index(); $table->foreign('user_id') ->references('id') ->on('users'); $table->unsignedBigInteger('approved_by') ->nullable() ->index(); $table->foreign('approved_by') ->references('id') ->on('users'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('ptos'); } }