refactor(db): added timezone check in so it comes over correct based on the backend timezone

This commit is contained in:
2026-06-01 16:05:36 -05:00
parent 45a0dee9ca
commit 2558b2e5bb
20 changed files with 55 additions and 37 deletions

View File

@@ -28,11 +28,15 @@ export const analyticsDaily = pgTable(
avgDurationMs: integer("avg_duration_ms").notNull(),
maxDurationMs: integer("max_duration_ms").notNull(),
firstHitAt: timestamp("first_hit_at").notNull(),
lastHitAt: timestamp("last_hit_at").notNull(),
firstHitAt: timestamp("first_hit_at", { withTimezone: true }).notNull(),
lastHitAt: timestamp("last_hit_at", { withTimezone: true }).notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at").defaultNow().notNull(),
createdAt: timestamp("created_at", { withTimezone: true })
.defaultNow()
.notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true })
.defaultNow()
.notNull(),
},
(table) => [
unique("analytics_daily_business_route_unique").on(