fix: migration

This commit is contained in:
Krispire Admin
2026-06-11 01:11:10 +05:30
parent 0655b2314d
commit 0b24ab4b45
6 changed files with 177 additions and 4 deletions
+5
View File
@@ -94,6 +94,11 @@ const fallbackTZ = "Asia/Kolkata"
// genuine UTC user re-reports their real zone on next load.
func (s *SadhnaService) resolveTZ(ctx context.Context, userID string) (string, *time.Location) {
tz, _ := s.logs.UserTimezone(ctx, userID)
// Canonicalize legacy aliases (e.g. stored "Asia/Calcutta") — the name
// is fed into SQL AT TIME ZONE, which rejects aliases on a Postgres
// without the tzdata backward links. Covers rows written before
// SetTimezone started canonicalizing.
tz = canonicalTZ(tz)
if tz == "" || tz == "UTC" {
tz = fallbackTZ
}