-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit will add a guard to the new migrations to ensure that they do not run if the columns already exist in the database.
- Loading branch information
Showing
2 changed files
with
2 additions
and
2 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
db/migrate/20240916182737_add_last_imported_at_to_bulkrax_importers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class AddLastImportedAtToBulkraxImporters < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :bulkrax_importers, :last_imported_at, :datetime | ||
add_column :bulkrax_importers, :last_imported_at, :datetime unless column_exists?(:bulkrax_importers, :last_imported_at) | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
db/migrate/20240916182823_add_next_import_at_to_bulkrax_importers.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
class AddNextImportAtToBulkraxImporters < ActiveRecord::Migration[5.1] | ||
def change | ||
add_column :bulkrax_importers, :next_import_at, :datetime | ||
add_column :bulkrax_importers, :next_import_at, :datetime unless column_exists?(:bulkrax_importers, :next_import_at) | ||
end | ||
end |