From 42cfca3784f8d018f3dafb485b5be7be9d3628ed Mon Sep 17 00:00:00 2001 From: isaac Date: Tue, 13 Aug 2024 09:34:06 -0700 Subject: [PATCH 1/2] Fix comment reactions pkey --- .../migrations/0089_fix_comment_reactions_pkey.sql | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql diff --git a/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql b/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql new file mode 100644 index 00000000000..58701dc5fe1 --- /dev/null +++ b/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql @@ -0,0 +1,11 @@ +begin; + +-- Step 1: Drop the existing primary key constraint +ALTER TABLE comment_reactions +DROP CONSTRAINT comment_reactions_pkey; + +-- Step 2: Add a new primary key constraint with both comment_id and user_id +ALTER TABLE comment_reactions +ADD CONSTRAINT comment_reactions_pkey PRIMARY KEY (comment_id, user_id); + +commit; \ No newline at end of file From 7a74af1321ee387097dcdfc3f1883b164aaa223b Mon Sep 17 00:00:00 2001 From: isaac Date: Tue, 13 Aug 2024 09:34:39 -0700 Subject: [PATCH 2/2] clean up comments --- .../ddl/migrations/0089_fix_comment_reactions_pkey.sql | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql b/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql index 58701dc5fe1..2fdf6ec2295 100644 --- a/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql +++ b/packages/discovery-provider/ddl/migrations/0089_fix_comment_reactions_pkey.sql @@ -1,10 +1,8 @@ begin; --- Step 1: Drop the existing primary key constraint ALTER TABLE comment_reactions DROP CONSTRAINT comment_reactions_pkey; --- Step 2: Add a new primary key constraint with both comment_id and user_id ALTER TABLE comment_reactions ADD CONSTRAINT comment_reactions_pkey PRIMARY KEY (comment_id, user_id);