correctif(data): ajoute la clé etrangère entre active_storage_attachements et active_storage_blobs uniquement si elle est manquante
This commit is contained in:
parent
899bb73ce8
commit
b0376ec99c
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
class FixActiveStorageAttachmentMissingFkOnBlobId < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id, validate: false
|
||||
if !foreign_key_exists?(:active_storage_attachments, :active_storage_blobs, column: :blob_id)
|
||||
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id, validate: false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue