fix(db): add missing foreign key on attachements blob_id
This commit is contained in:
parent
84b9644bcd
commit
2485fb67cc
3 changed files with 12 additions and 1 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
class AddForeignKeyToAttachmentsBlobId < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
add_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id, validate: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ValidateForeignKeyOnAttachmentsBlobId < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
validate_foreign_key :active_storage_attachments, :active_storage_blobs, column: :blob_id
|
||||||
|
end
|
||||||
|
end
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 2022_09_03_151920) do
|
ActiveRecord::Schema.define(version: 2022_09_04_151920) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pgcrypto"
|
enable_extension "pgcrypto"
|
||||||
|
@ -869,6 +869,7 @@ ActiveRecord::Schema.define(version: 2022_09_03_151920) do
|
||||||
t.index ["acronym"], name: "index_zones_on_acronym", unique: true
|
t.index ["acronym"], name: "index_zones_on_acronym", unique: true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||||
add_foreign_key "administrateurs", "users"
|
add_foreign_key "administrateurs", "users"
|
||||||
add_foreign_key "administrateurs_instructeurs", "administrateurs"
|
add_foreign_key "administrateurs_instructeurs", "administrateurs"
|
||||||
|
|
Loading…
Add table
Reference in a new issue