Skip to content

Commit

Permalink
Migration fix for missing soft deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeelio committed Oct 13, 2023
1 parent 5356d2c commit 81d7083
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
return new class() extends Migration {
public function up()
{
Schema::table('fares', function (Blueprint $table) {
$table->softDeletes();
});

if (!Schema::hasColumns('pirep_fares', ['code', 'name'])) {
Schema::table('pirep_fares', function (Blueprint $table) {
$table->unsignedBigInteger('fare_id')->nullable()->change();
Expand All @@ -21,6 +25,8 @@ public function up()
->default(FareType::PASSENGER)
->nullable()
->after('capacity');
$table->softDeletes();

});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public function up()
});

// Fare
Schema::table('fares', function (Blueprint $table) {
$table->softDeletes();
});
if (!Schema::hasColumn('fares', 'deleted_at')) {
Schema::table('fares', function (Blueprint $table) {
$table->softDeletes();
});
}

// Flight
Schema::table('flights', function (Blueprint $table) {
Expand Down

0 comments on commit 81d7083

Please sign in to comment.