Merge pull request #2907 from omnivore-app/fix/db-highlight-migration-steps

Make highlight modification two steps
This commit is contained in:
Jackson Harper 2023-10-11 19:32:23 +08:00 committed by GitHub
commit 2fba02026d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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;