Skip to content

chore: add IANA timezone column to site schema#806

Merged
RussH merged 1 commit into
opencats:masterfrom
anonymoususer72041:chore/add-iana-timezone-column
Jun 23, 2026
Merged

chore: add IANA timezone column to site schema#806
RussH merged 1 commit into
opencats:masterfrom
anonymoususer72041:chore/add-iana-timezone-column

Conversation

@anonymoususer72041

Copy link
Copy Markdown
Contributor

Summary

This PR adds a new time_zone_iana column to the site table.

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_zone column, 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_iana available 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.

@anonymoususer72041 anonymoususer72041 requested a review from RussH June 10, 2026 13:54
@anonymoususer72041

Copy link
Copy Markdown
Contributor Author

@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.

@anonymoususer72041 anonymoususer72041 force-pushed the chore/add-iana-timezone-column branch from b5fd6cb to 356c5cf Compare June 22, 2026 14:51

@RussH RussH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@RussH RussH merged commit df4b2f9 into opencats:master Jun 23, 2026
4 checks passed
@anonymoususer72041 anonymoususer72041 deleted the chore/add-iana-timezone-column branch June 23, 2026 09:07
@anonymoususer72041

Copy link
Copy Markdown
Contributor Author

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.

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?

This should be superseeded by #805 anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants