mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 22:31:20 +00:00
23 lines
520 B
SQL
23 lines
520 B
SQL
ALTER TABLE post_like
|
|
ADD COLUMN published timestamptz NOT NULL DEFAULT now();
|
|
|
|
ALTER TABLE comment_like
|
|
ADD COLUMN published timestamptz NOT NULL DEFAULT now();
|
|
|
|
ALTER TABLE comment_like
|
|
ADD COLUMN post_id int REFERENCES post ON UPDATE CASCADE ON DELETE CASCADE;
|
|
|
|
UPDATE
|
|
comment_like
|
|
SET
|
|
post_id = (
|
|
SELECT
|
|
post_id
|
|
FROM
|
|
comment
|
|
WHERE
|
|
comment.id = comment_like.comment_id);
|
|
|
|
ALTER TABLE comment_like
|
|
ALTER COLUMN post_id SET NOT NULL;
|
|
|