fix(database): postgresql release timestamps timezone handling (#1343)

fix(database): Correct timezone handling for release timestamps

Changed the column type for release timestamps from 'timestamp' to 'timestamptz' in the PostgreSQL database. This update ensures that the release ages are accurately reflected in the web UI by storing the correct timezone information. Previously, the data was stored in UTC but interpreted as local user time, causing a 3-hour offset in the web UI or in my case 11-hour offset. The conversion now correctly interprets and displays the release times based on UTC.

Fixes #1138
This commit is contained in:
KaiserBh 2024-02-27 21:49:13 +11:00 committed by GitHub
parent c600f41e5a
commit 47a1af8600
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -230,7 +230,7 @@ CREATE TABLE "release"
filter TEXT,
protocol TEXT,
implementation TEXT,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
timestamp TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP,
info_url TEXT,
download_url TEXT,
group_id TEXT,
@ -862,5 +862,8 @@ ALTER TABLE filter
`UPDATE irc_network
SET server = 'irc.nebulance.io'
WHERE server = 'irc.nebulance.cc';
`,
`ALTER TABLE "release"
ALTER COLUMN timestamp TYPE timestamptz USING timestamp AT TIME ZONE 'UTC';
`,
}