mirror of
https://github.com/jjbrunton/Sauci.git
synced 2026-11-01 18: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,
|
target: profiles.id,
|
||||||
set: {
|
set: {
|
||||||
email: sql`coalesce(excluded.email, ${profiles.email})`,
|
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();
|
}).returning();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user