add index for exclusive yclients rules

This commit is contained in:
Pasha 2025-10-27 15:28:33 +03:00
parent 08ce39d8a8
commit cf81806650
2 changed files with 4 additions and 1 deletions

@ -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;
DROP INDEX if exist idx_unique_tokens_yclients;
DROP INDEX if exist idx_unique_yclients_rules;

@ -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 (