fix: use explicit UTC timestamp in PostgreSQL dialect

PostgreSQL's CURRENT_TIMESTAMP returns session-local time, unlike
SYSUTCDATETIME() (SQL Server) and UTC_TIMESTAMP() (MySQL) which
explicitly return UTC. Switch to (NOW() AT TIME ZONE 'UTC') to
keep operation history timestamps consistent across all databases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-04-28 21:48:28 +08:00
parent 21089e8b40
commit a6c2e2ccc2

View File

@@ -26,7 +26,7 @@ export class PostgreSqlDialect implements SqlDialect {
}
currentTimestamp(): string {
return 'CURRENT_TIMESTAMP'
return "(NOW() AT TIME ZONE 'UTC')"
}
upsert(params: {