Add new migrations
This commit is contained in:
parent
f04c9b81cb
commit
2cbe24584b
5
migrations/16/down.sql
Normal file
5
migrations/16/down.sql
Normal 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
23
migrations/16/up.sql
Normal 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;
|
Loading…
x
Reference in New Issue
Block a user