From add0394e32c54e35a041d49bbaa437c01d03fcf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=20?= =?UTF-8?q?=D0=97=D0=B8=D0=BC=D0=B8=D0=BD?= Date: Sun, 3 May 2026 23:45:14 +0300 Subject: [PATCH] fix(migrations): drop actual records scope_check constraint (was named _scope_check, not _data_scope_check) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 0008 dropped IF EXISTS dictionary_records_data_scope_check, но реальный constraint в 0003 назывался dictionary_records_scope_check (без _data_). Старый lowercase constraint остался жив — записи с UPPERCASE data_scope не проходили. 0009 удаляет оба варианта имени и создаёт UPPERCASE constraint. --- .../changes/0009-fix-records-scope-check.xml | 22 +++++++++++++++++++ .../main/resources/db/changelog/master.xml | 1 + 2 files changed, 23 insertions(+) create mode 100644 ordinis-migrations/src/main/resources/db/changelog/changes/0009-fix-records-scope-check.xml diff --git a/ordinis-migrations/src/main/resources/db/changelog/changes/0009-fix-records-scope-check.xml b/ordinis-migrations/src/main/resources/db/changelog/changes/0009-fix-records-scope-check.xml new file mode 100644 index 0000000..20a19cc --- /dev/null +++ b/ordinis-migrations/src/main/resources/db/changelog/changes/0009-fix-records-scope-check.xml @@ -0,0 +1,22 @@ + + + + + В 0003 constraint назывался dictionary_records_scope_check (а не _data_scope_check как + ожидала 0008). Дропаем правильное имя и пересоздаём с UPPERCASE. + + ALTER TABLE dictionary_records + DROP CONSTRAINT IF EXISTS dictionary_records_scope_check; + ALTER TABLE dictionary_records + DROP CONSTRAINT IF EXISTS dictionary_records_data_scope_check; + ALTER TABLE dictionary_records + ADD CONSTRAINT dictionary_records_data_scope_check + CHECK (data_scope IN ('PUBLIC', 'INTERNAL', 'RESTRICTED')); + + + + diff --git a/ordinis-migrations/src/main/resources/db/changelog/master.xml b/ordinis-migrations/src/main/resources/db/changelog/master.xml index 0bead67..2e11263 100644 --- a/ordinis-migrations/src/main/resources/db/changelog/master.xml +++ b/ordinis-migrations/src/main/resources/db/changelog/master.xml @@ -13,5 +13,6 @@ +