4.5.0: Улучшена работа с задачами желаний
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m25s

This commit is contained in:
poignatov
2026-01-30 19:53:13 +03:00
parent 25f0c2697a
commit e955494dc8
8 changed files with 302 additions and 62 deletions

View File

@@ -0,0 +1,13 @@
-- Migration: Revert wishlist_id unique index fix
-- Date: 2026-01-30
--
-- This migration reverts the composite unique index back to the original
-- unique index that only checked wishlist_id.
-- Drop the composite unique index
DROP INDEX IF EXISTS idx_tasks_wishlist_id_user_id_unique;
-- Restore the original unique index on wishlist_id only
CREATE UNIQUE INDEX idx_tasks_wishlist_id_unique
ON tasks(wishlist_id)
WHERE wishlist_id IS NOT NULL AND deleted = FALSE;

View File

@@ -0,0 +1,16 @@
-- Migration: Fix wishlist_id unique index to allow multiple users
-- Date: 2026-01-30
--
-- This migration fixes the unique index on wishlist_id to allow multiple users
-- to create tasks for the same wishlist item. The old index only checked wishlist_id,
-- but now we need a composite unique index on (wishlist_id, user_id).
-- Drop the old unique index that only checked wishlist_id
DROP INDEX IF EXISTS idx_tasks_wishlist_id_unique;
-- Create a new composite unique index on (wishlist_id, user_id)
-- This allows multiple users to have tasks for the same wishlist item,
-- but prevents the same user from having multiple tasks for the same wishlist item
CREATE UNIQUE INDEX idx_tasks_wishlist_id_user_id_unique
ON tasks(wishlist_id, user_id)
WHERE wishlist_id IS NOT NULL AND deleted = FALSE;