Merge pull request #8648 from demarches-simplifiees/ensure-pg-fk-between-attachments-and-blobs

correctif(db): force active_storage_attachments.blob fk on active_storage_blobs
This commit is contained in:
mfo 2023-02-16 16:59:36 +01:00 committed by GitHub
commit 3b3bdbfe3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class ValidateForeignKeyBetweenAttachmentsAndBlobs < ActiveRecord::Migration[6.1]
def up
validate_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2023_02_16_130722) do
ActiveRecord::Schema.define(version: 2023_02_16_141558) do
# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"