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 7ab997120..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_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"