Skip to content

Commit

Permalink
Add guard clause to check if table exists
Browse files Browse the repository at this point in the history
This should solve one of the reasons deploying to staging fails. re: duplicat table rancher error from db-setup
  • Loading branch information
Shana Moore committed Jan 23, 2024
1 parent 391a7a3 commit b5b1eae
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# This migration comes from iiif_print (originally 20181214181358)
class CreateIiifPrintDerivativeAttachments < ActiveRecord::Migration[5.0]
def change
create_table :iiif_print_derivative_attachments do |t|
t.string :fileset_id
t.string :path
t.string :destination_name
unless unless table_exists?(:iiif_print_derivative_attachments)
create_table :iiif_print_derivative_attachments do |t|
t.string :fileset_id
t.string :path
t.string :destination_name

t.timestamps
t.timestamps
end
add_index :iiif_print_derivative_attachments, :fileset_id
end
add_index :iiif_print_derivative_attachments, :fileset_id
end
end

0 comments on commit b5b1eae

Please sign in to comment.