Class: AddForeignKeyToActiveStorageForBlobId

Inherits:
Object
  • Object
show all
Defined in:
lib/nexmo_developer/db/migrate/20191022100247_add_foreign_key_to_active_storage_for_blob_id.rb

Overview

This migration comes from active_storage (originally 20180723000244)

Instance Method Summary collapse

Instance Method Details

#upObject



3
4
5
6
7
8
9
# 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