Skip to content

Commit 6499834

Browse files
JarrodJarrodCTaylor
Jarrod
authored and
JarrodCTaylor
committed
Enhancement: Use clock_timestamp instead of now
Using clock_timestamp as the default value in the field is more accurate than now. Chalk it up as a best practice thing for Postres
1 parent a0522dc commit 6499834

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/authenticated_compojure_api/tables/user/password_reset_key.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CREATE TABLE IF NOT EXISTS password_reset_key (
55
, reset_key TEXT NOT NULL UNIQUE
66
, already_used BOOLEAN NOT NULL DEFAULT FALSE
77
, user_id INTEGER REFERENCES registered_user (id) ON DELETE CASCADE
8-
, valid_until TIMESTAMP WITH TIME ZONE DEFAULT NOW() + INTERVAL '24 hours'
8+
, valid_until TIMESTAMP WITH TIME ZONE DEFAULT CLOCK_TIMESTAMP() + INTERVAL '24 hours'
99
);
1010

1111
-- name: drop-password-reset-key-table!

0 commit comments

Comments
 (0)