Skip to content

Commit

Permalink
add default value = now() to updatedAt field in highlight tables only
Browse files Browse the repository at this point in the history
  • Loading branch information
sywhb committed Oct 11, 2023
1 parent 00b33b6 commit 3201f96
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
10 changes: 0 additions & 10 deletions packages/db/migrations/0131.do.add_default_value_to_updated_at.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@

BEGIN;

UPDATE omnivore.user_profile SET updated_at = created_at WHERE updated_at IS NULL;
ALTER TABLE omnivore.user_profile
ALTER COLUMN updated_at SET DEFAULT current_timestamp,
ALTER COLUMN updated_at SET NOT NULL;

UPDATE omnivore.labels SET updated_at = created_at WHERE updated_at IS NULL;
ALTER TABLE omnivore.labels
ALTER COLUMN updated_at SET DEFAULT current_timestamp,
ALTER COLUMN updated_at SET NOT NULL;

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

BEGIN;

ALTER TABLE omnivore.user_profile ALTER COLUMN updated_at DROP NOT NULL;

ALTER TABLE omnivore.labels ALTER COLUMN updated_at DROP NOT NULL;

ALTER TABLE omnivore.highlight ALTER COLUMN updated_at DROP NOT NULL;

COMMIT;

0 comments on commit 3201f96

Please sign in to comment.