From b79860229ea8681a8478b9a3ac2a81674bed2688 Mon Sep 17 00:00:00 2001 From: mfo Date: Fri, 30 Aug 2024 15:07:21 +0200 Subject: [PATCH] tech(data): validate fk between champs.dossier_id and dossiers.id --- ...0240830125438_validate_foreign_key_champs_dossiers.rb | 9 +++++++++ db/schema.rb | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20240830125438_validate_foreign_key_champs_dossiers.rb diff --git a/db/migrate/20240830125438_validate_foreign_key_champs_dossiers.rb b/db/migrate/20240830125438_validate_foreign_key_champs_dossiers.rb new file mode 100644 index 000000000..857619a53 --- /dev/null +++ b/db/migrate/20240830125438_validate_foreign_key_champs_dossiers.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ValidateForeignKeyChampsDossiers < ActiveRecord::Migration[7.0] + disable_ddl_transaction! + + def change + validate_foreign_key :champs, :dossiers + end +end diff --git a/db/schema.rb b/db/schema.rb index bbef3938d..08a60aada 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[7.0].define(version: 2024_08_29_141049) do +ActiveRecord::Schema[7.0].define(version: 2024_08_30_125438) do # These are extensions that must be enabled in order to support this database enable_extension "pg_buffercache" enable_extension "pg_stat_statements"