Skip to content

Commit

Permalink
fix: Using current time in UTC as default in Postgresql
Browse files Browse the repository at this point in the history
Using current time in UTC as default in Postgresql for created and modified time.

Signed-off-by: bruce <[email protected]>
  • Loading branch information
weichou1229 committed Nov 19, 2024
1 parent 187954f commit 64c457b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/core-keeper/res/db/sql/01-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS core_keeper.config (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
key TEXT NOT NULL,
value TEXT NOT NULL,
created timestamp NOT NULL DEFAULT now(),
modified timestamp NOT NULL DEFAULT now()
created timestamp NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
modified timestamp NOT NULL DEFAULT (now() AT TIME ZONE 'utc')
);

-- core_keeper.registry is used to store the registry information
Expand Down
2 changes: 1 addition & 1 deletion cmd/support-scheduler/res/db/sql/01-tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ CREATE TABLE IF NOT EXISTS support_scheduler.record (
action JSONB NOT NULL,
status TEXT NOT NULL,
scheduled_at timestamp NOT NULL,
created timestamp NOT NULL DEFAULT now()
created timestamp NOT NULL DEFAULT (now() AT TIME ZONE 'utc')
);

0 comments on commit 64c457b

Please sign in to comment.