Make highlight modification two steps

This commit is contained in:
Jackson Harper 2023-10-11 19:27:03 +08:00
parent 6ad14dfc14
commit 76b382966d
3 changed files with 22 additions and 2 deletions

View file

@ -6,7 +6,6 @@ BEGIN;
UPDATE omnivore.highlight SET updated_at = created_at WHERE updated_at IS NULL;
ALTER TABLE omnivore.highlight
ALTER COLUMN updated_at SET DEFAULT current_timestamp,
ALTER COLUMN updated_at SET NOT NULL;
ALTER COLUMN updated_at SET DEFAULT current_timestamp;
COMMIT;

View file

@ -0,0 +1,11 @@
-- Type: DO
-- Name: add_highlight_not_null
-- Description: Add a not null clause to the highlight updated_at column
BEGIN;
ALTER TABLE omnivore.highlight
ALTER COLUMN updated_at SET NOT NULL ;
COMMIT;

View file

@ -0,0 +1,10 @@
-- Type: UNDO
-- Name: add_highlight_not_null
-- Description: Add a not null clause to the highlight updated_at column
BEGIN;
ALTER TABLE omnivore.highlight
ALTER COLUMN updated_at DROP NOT NULL;
COMMIT;