Time unification

This commit is contained in:
2026-06-17 15:06:38 -04:00
parent 069a44bd54
commit 54a2460eac
67 changed files with 1442 additions and 1329 deletions
+7 -1
View File
@@ -5,7 +5,13 @@ const { Pool } = pg;
let pool;
export function initPool(config) {
pool = new Pool(config);
pool = new Pool({
// Pin the session timezone to business time (matches the
// `ALTER DATABASE inventory_db SET timezone = 'America/Chicago'` default)
// so a DB restore/migration can't silently revert date semantics.
options: '-c TimeZone=America/Chicago',
...config,
});
return pool;
}
+4 -1
View File
@@ -97,7 +97,10 @@ async function setupSshTunnel() {
password: process.env.PROD_DB_PASSWORD,
database: process.env.PROD_DB_NAME,
port: Number(process.env.PROD_DB_PORT) || 3306,
timezone: 'Z',
// DATETIME columns store Central wall-clock literals — return them as
// strings; parse with shared/business-time parseMySql() if instants are
// ever needed (see docs/TIME.md).
dateStrings: true,
};
return new Promise((resolve, reject) => {