mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-10-31 10:19:43 +00:00
Merge pull request #9 from jjbrunton/staging
fix(api): keep auth sync timestamps monotonic
This commit is contained in:
1 file changed
+4
-1
@@ -83,7 +83,10 @@ export class PostgresRepository implements ApiRepository {
|
||||
target: profiles.id,
|
||||
set: {
|
||||
email: sql`coalesce(excluded.email, ${profiles.email})`,
|
||||
authSyncedAt: new Date(),
|
||||
// Keep the write on the same clock as the column default. API and
|
||||
// PostgreSQL hosts can differ slightly, which must not move this
|
||||
// monotonic sync marker backwards.
|
||||
authSyncedAt: sql`now()`,
|
||||
},
|
||||
}).returning();
|
||||
|
||||
|
||||
Reference in new issue
Block a user