From cf81806650481ded825981590e5e27d77e878ed0 Mon Sep 17 00:00:00 2001 From: Pasha Date: Mon, 27 Oct 2025 15:28:33 +0300 Subject: [PATCH] add index for exclusive yclients rules --- dal/schema/000028_init.down.sql | 3 ++- dal/schema/000028_init.up.sql | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dal/schema/000028_init.down.sql b/dal/schema/000028_init.down.sql index fc104d9..5cde0bd 100644 --- a/dal/schema/000028_init.down.sql +++ b/dal/schema/000028_init.down.sql @@ -6,4 +6,5 @@ DROP TABLE If EXIST YclientsServices; DROP TABLE If EXIST YclientsTimeSlots; DROP TABLE If EXIST YclientsRules; -DROP INDEX if exist idx_unique_tokens_yclients; \ No newline at end of file +DROP INDEX if exist idx_unique_tokens_yclients; +DROP INDEX if exist idx_unique_yclients_rules; \ No newline at end of file diff --git a/dal/schema/000028_init.up.sql b/dal/schema/000028_init.up.sql index d3025b2..a95ff20 100644 --- a/dal/schema/000028_init.up.sql +++ b/dal/schema/000028_init.up.sql @@ -86,6 +86,8 @@ CREATE TABLE IF NOT EXISTS YclientsRules ( CreatedAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ); +CREATE UNIQUE INDEX idx_unique_yclients_rules ON YclientsRules (SalonID, QuizID) WHERE Deleted = false; + DO $$ BEGIN IF NOT EXISTS (