From 514835af1c46bc6721fd20b9f30c5a55f0bbeb6c Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 16 Feb 2023 15:43:35 +0100 Subject: [PATCH] correctif(db): force active_storage_attachments.blob fk on active_storage_blobs --- ...558_validate_foreign_key_between_attachments_and_blobs.rb | 5 +++++ db/schema.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20230216141558_validate_foreign_key_between_attachments_and_blobs.rb diff --git a/db/migrate/20230216141558_validate_foreign_key_between_attachments_and_blobs.rb b/db/migrate/20230216141558_validate_foreign_key_between_attachments_and_blobs.rb new file mode 100644 index 000000000..ba383c80a --- /dev/null +++ b/db/migrate/20230216141558_validate_foreign_key_between_attachments_and_blobs.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 59abcc837..14d0f9498 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_02_07_105539) 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"