Skip to content

Commit

Permalink
i438 - fix erroring migrations (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaLMoore authored Apr 25, 2022
1 parent 76f3086 commit 46efeba
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
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
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
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

0 comments on commit 46efeba

Please sign in to comment.