This commit is contained in:
Adrian Hopek
2022-02-18 14:22:01 +01:00
parent fae50cb21c
commit b745ab990c
10 changed files with 162 additions and 8 deletions

View File

@@ -14,6 +14,7 @@ return new class() extends Migration {
Schema::create("vacation_requests", function (Blueprint $table): void {
$table->id();
$table->string("name");
$table->foreignIdFor(User::class, "creator_id")->constrained("users")->cascadeOnDelete();
$table->foreignIdFor(User::class)->constrained()->cascadeOnDelete();
$table->foreignIdFor(YearPeriod::class)->constrained()->cascadeOnDelete();
$table->string("type");
@@ -21,6 +22,7 @@ return new class() extends Migration {
$table->date("from");
$table->date("to");
$table->text("comment")->nullable();
$table->boolean("skip_flow")->default(false);
$table->timestamps();
});
}

View File

@@ -77,6 +77,7 @@ class DatabaseSeeder extends Seeder
VacationRequest::factory()
->count(10)
->for($user)
->for($user, "creator")
->sequence(fn() => [
"year_period_id" => $yearPeriods->random()->id,
])