21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-04-28 23:10:49 +02:00
chexpire/db/migrate/20190816223645_add_foreign_key_constraint_to_active_storage_attachments_for_blob_id.active_storage.rb
Jérémy Lecour 8a3cfb447b Updates for Rails 6.0
Temporary workarounds :
* devise is from GitHub
* letter_opener_web is disabled
2019-08-17 00:54:17 +02:00

11 lines
411 B
Ruby

# This migration comes from active_storage (originally 20180723000244)
class AddForeignKeyConstraintToActiveStorageAttachmentsForBlobId < ActiveRecord::Migration[6.0]
def up
return if foreign_key_exists?(:active_storage_attachments, column: :blob_id)
if table_exists?(:active_storage_blobs)
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
end
end
end