-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i438 - fix erroring migrations (#487)
- Loading branch information
1 parent
76f3086
commit 46efeba
Showing
3 changed files
with
10 additions
and
8 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
db/migrate/20211203195233_rename_children_counters_to_relationships.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,6 +1,6 @@ | ||
class RenameChildrenCountersToRelationships < ActiveRecord::Migration[5.2] | ||
def change | ||
rename_column :bulkrax_importer_runs, :processed_children, :processed_relationships | ||
rename_column :bulkrax_importer_runs, :failed_children, :failed_relationships | ||
rename_column :bulkrax_importer_runs, :processed_children, :processed_relationships unless column_exists?(:bulkrax_importer_runs, :processed_relationships) | ||
rename_column :bulkrax_importer_runs, :failed_children, :failed_relationships unless column_exists?(:bulkrax_importer_runs, :failed_relationships) | ||
end | ||
end |
12 changes: 7 additions & 5 deletions
12
db/migrate/20220301001839_create_bulkrax_pending_relationships.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,11 +1,13 @@ | ||
class CreateBulkraxPendingRelationships < ActiveRecord::Migration[5.2] | ||
def change | ||
create_table :bulkrax_pending_relationships do |t| | ||
t.belongs_to :bulkrax_importer_run, foreign_key: true, null: false | ||
t.string :parent_id, null: false | ||
t.string :child_id, null: false | ||
unless table_exists?(:bulkrax_pending_relationships) | ||
create_table :bulkrax_pending_relationships do |t| | ||
t.belongs_to :bulkrax_importer_run, foreign_key: true, null: false | ||
t.string :parent_id, null: false | ||
t.string :child_id, null: false | ||
|
||
t.timestamps | ||
t.timestamps | ||
end | ||
end | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
db/migrate/20220303212810_add_order_to_bulkrax_pending_relationships.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 AddOrderToBulkraxPendingRelationships < ActiveRecord::Migration[5.2] | ||
def change | ||
add_column :bulkrax_pending_relationships, :order, :integer, default: 0 | ||
add_column :bulkrax_pending_relationships, :order, :integer, default: 0 unless column_exists?(:bulkrax_pending_relationships, :order) | ||
end | ||
end |