From a6c2e2ccc2d60c79eb38c54c90bd0e101b6cfa06 Mon Sep 17 00:00:00 2001 From: Misaka Date: Tue, 28 Apr 2026 21:48:28 +0800 Subject: [PATCH] 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 --- src/main/services/database/dialects/postgresql-dialect.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/services/database/dialects/postgresql-dialect.ts b/src/main/services/database/dialects/postgresql-dialect.ts index d3d0141..a9f082f 100644 --- a/src/main/services/database/dialects/postgresql-dialect.ts +++ b/src/main/services/database/dialects/postgresql-dialect.ts @@ -26,7 +26,7 @@ export class PostgreSqlDialect implements SqlDialect { } currentTimestamp(): string { - return 'CURRENT_TIMESTAMP' + return "(NOW() AT TIME ZONE 'UTC')" } upsert(params: {