topfans/backend/scripts/migrations/migrate_drop_asset_likes_star_constraint.sql
2026-05-25 19:03:35 +08:00

6 lines
371 B
SQL

-- Drop the overly strict unique constraint that prevents users from liking
-- the same asset across different exhibitions. The correct constraint is
-- (user_id, asset_id, exhibition_id), not (user_id, asset_id, star_id).
-- This allows a user to like the same asset once per exhibition.
ALTER TABLE asset_likes DROP CONSTRAINT IF EXISTS uk_asset_likes_user_asset_star;