Skip to content

Commit

Permalink
Add the eol_explicit column earlier to accomodate the observer
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Oct 13, 2023
1 parent c14a01e commit 0b39591
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ public function up()
if (!Schema::hasColumn('assets', 'asset_eol_date')) {
$table->date('asset_eol_date')->after('purchase_date')->nullable()->default(null);
}

// This is a temporary shim so we don't have to modify the asset observer for migrations where
// there is a large version difference. (See the AssetObserver notes). This column gets created
// later in 2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php
// but we have to temporarily create it now so the save method below doesn't break
if (!Schema::hasColumn('assets', 'eol_explicit')) {
$table->boolean('eol_explicit')->default(false)->after('asset_eol_date');
}
});

// Chunk the model query to get the models that do have an EOL date
Expand Down

0 comments on commit 0b39591

Please sign in to comment.