fix(data): add missing foreign key on production between champs.dossier_id and dossier.id, use validate: false to delay validation

This commit is contained in:
mfo 2024-08-26 15:05:22 +02:00
parent 8e7e8d9624
commit ccddf885f6
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddMissingIndexChampsToDossier < ActiveRecord::Migration[7.0]
def change
add_foreign_key :champs, :dossiers, if_not_exists: true, validate: false
end
end

View file

@ -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[7.0].define(version: 2024_07_29_160650) do ActiveRecord::Schema[7.0].define(version: 2024_08_26_130121) 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 "pg_buffercache" enable_extension "pg_buffercache"
enable_extension "pg_stat_statements" enable_extension "pg_stat_statements"