chore: add IANA timezone column to site schema#806
Conversation
|
@RussH we want to merge this PR rather sooner than later as it needs to be included in a previous release regarding upcoming UTC work. |
de96a9e to
b5fd6cb
Compare
b5fd6cb to
356c5cf
Compare
RussH
left a comment
There was a problem hiding this comment.
Can we change this to use plain ALTER TABLE rather than ALTER IGNORE TABLE?
ALTER IGNORE TABLE was deprecated/removed in MySQL 5.6/5.7, and we are only adding a new column, IGNORE is not needed.
Also, for consistency with cats_schema.sql, can we explicitly define the column collation in the migration as well, e.g. COLLATE utf8_unicode_ci?
|
Sorry, just saw your comment now. Feel free to push into my PRs or suggest changes via GitHubs review function which I can directly approve via GitHub next time you find something.
This should be superseeded by #805 anyways. |
Summary
This PR adds a new
time_zone_ianacolumn to thesitetable.Fresh installations now create the column as part of the base schema and existing installations receive it through schema update. The column defaults to
UTC.This PR intentionally does not change the existing legacy
site.time_zonecolumn, installer behavior, runtime timezone handling, timestamp storage or timestamp display behavior.Motivation
OpenCATS currently relies on a legacy numeric timezone offset. This is not sufficient for future timezone-aware timestamp handling, especially if timestamp storage is later migrated toward UTC and display logic needs to use real regional timezone rules.
Before the installer or settings screens can start writing an IANA timezone identifier, the database schema must provide a place to store it. This is especially important for upgraded installations: the installer may run before later schema migrations or setup changes can depend on the new field. Without adding the column first, future installer or upgrade logic would not be able to reliably persist the selected IANA timezone for both fresh and existing instances.
This PR is therefore a small preparatory schema change. It makes
site.time_zone_ianaavailable while keeping all existing offset-based behavior unchanged. The actual transition to writing IANA timezone values, changing runtime timezone handling, migrating timestamps to UTC, ..., are intentionally left for follow-up PRs.