mirror of
https://github.com/Dvorinka/MyClubServer.git
synced 2026-06-05 03:02:56 +00:00
hot fix #1
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
-- Add unique constraint for comment reactions if it doesn't exist
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.table_constraints
|
||||
WHERE constraint_name = 'unique_comment_user_reaction'
|
||||
AND table_name = 'comment_reactions'
|
||||
) THEN
|
||||
ALTER TABLE comment_reactions ADD CONSTRAINT unique_comment_user_reaction UNIQUE (comment_id, user_id);
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user