mirror of
https://0xacab.org/sutty/sutty
synced 2024-07-06 02:35:45 +00:00
14 lines
464 B
Ruby
14 lines
464 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
# 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)
|
||
|
|
||
|
return unless table_exists?(:active_storage_blobs)
|
||
|
|
||
|
add_foreign_key :active_storage_attachments,
|
||
|
:active_storage_blobs, column: :blob_id
|
||
|
end
|
||
|
end
|