mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-11 12:46:31 +00:00
15 lines
491 B
SQL
15 lines
491 B
SQL
-- This file should undo anything in `up.sql`
|
|
ALTER TABLE comment_seers RENAME TO tmp_comment_seers;
|
|
|
|
CREATE TABLE comment_seers (
|
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
comment_id INTEGER REFERENCES comments(id) ON DELETE CASCADE NOT NULL,
|
|
user_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
|
|
UNIQUE (comment_id, user_id)
|
|
);
|
|
|
|
INSERT INTO comment_seers(id, comment_id, user_id)
|
|
SELECT id, comment_id, user_id
|
|
FROM tmp_comment_seers;
|
|
|
|
DROP TABLE tmp_comment_seers;
|