mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-22 20:31:19 +00:00
restore value of comment_like.post_id
This commit is contained in:
parent
1a0770a0ef
commit
719efb28bc
4 changed files with 22 additions and 3 deletions
|
@ -23,7 +23,7 @@ fi
|
|||
--danger-dummy-mode \
|
||||
--api-key "my-pictrs-key" \
|
||||
filesystem -p /tmp/pictrs/files \
|
||||
sled -p /tmp/pictrs/sled-repo 2>&1 &
|
||||
sled -p /tmp/pictrs/sled-repo &
|
||||
|
||||
for INSTANCE in lemmy_alpha lemmy_beta lemmy_gamma lemmy_delta lemmy_epsilon; do
|
||||
echo "DB URL: ${LEMMY_DATABASE_URL} INSTANCE: $INSTANCE"
|
||||
|
|
|
@ -11,7 +11,7 @@ killall -s1 lemmy_server || true
|
|||
popd
|
||||
|
||||
pnpm i
|
||||
pnpm api-test || true
|
||||
pnpm api-test-image || true
|
||||
|
||||
killall -s1 lemmy_server || true
|
||||
killall -s1 pict-rs || true
|
||||
|
|
|
@ -1,6 +1,23 @@
|
|||
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 NOT NULL;
|
||||
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;
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
ALTER TABLE post_like
|
||||
DROP published;
|
||||
|
||||
ALTER TABLE comment_like
|
||||
DROP published;
|
||||
|
||||
ALTER TABLE comment_like
|
||||
DROP post_id;
|
||||
|
||||
|
|
Loading…
Reference in a new issue