Add new migrations

This commit is contained in:
swagg boi 2025-03-26 14:38:24 -04:00
parent f04c9b81cb
commit 2cbe24584b
2 changed files with 28 additions and 0 deletions

5
migrations/16/down.sql Normal file
View File

@ -0,0 +1,5 @@
ALTER TABLE threads
DROP COLUMN markdown_status;
ALTER TABLE remarks
DROP COLUMN markdown_status;

23
migrations/16/up.sql Normal file
View File

@ -0,0 +1,23 @@
ALTER TABLE threads
ADD COLUMN markdown_status BOOLEAN;
-- Since Markdown was default, set existing threads to true
UPDATE threads
SET markdown_status = TRUE;
-- Now we can make it NOT NULL
ALTER TABLE threads
ALTER COLUMN markdown_status
SET NOT NULL;
-- Do the same for remarks
ALTER TABLE remarks
ADD COLUMN markdown_status BOOLEAN;
UPDATE remarks
SET markdown_status = TRUE;
ALTER TABLE remarks
ALTER COLUMN markdown_status
SET NOT NULL;