Update down.sql

This commit is contained in:
dullbananas 2024-06-05 07:59:55 -07:00 committed by GitHub
parent 8883f776c8
commit b7e8981d29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,8 +1,8 @@
ALTER TABLE comment_like ALTER TABLE comment_actions
ADD COLUMN post_id int REFERENCES post ON UPDATE CASCADE ON DELETE CASCADE; ADD COLUMN post_id int REFERENCES post ON UPDATE CASCADE ON DELETE CASCADE;
UPDATE UPDATE
comment_like comment_actions
SET SET
post_id = ( post_id = (
SELECT SELECT
@ -10,8 +10,7 @@ SET
FROM FROM
comment comment
WHERE WHERE
comment.id = comment_like.comment_id); comment.id = comment_actions.comment_id)
WHERE
ALTER TABLE comment_like liked IS NOT NULL;
ALTER COLUMN post_id SET NOT NULL;