class AddForeignKeyToActiveStorageForBlobId
This migration comes from active_storage (originally 20180723000244)
Public Instance Methods
up()
click to toggle source
# File lib/nexmo_developer/db/migrate/20191022100247_add_foreign_key_to_active_storage_for_blob_id.rb, line 3 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