Skip to content

refactor: migrate database encoding to utf8mb4#805

Open
anonymoususer72041 wants to merge 5 commits into
opencats:masterfrom
anonymoususer72041:refactor/database-utf8mb4-encoding
Open

refactor: migrate database encoding to utf8mb4#805
anonymoususer72041 wants to merge 5 commits into
opencats:masterfrom
anonymoususer72041:refactor/database-utf8mb4-encoding

Conversation

@anonymoususer72041

Copy link
Copy Markdown
Contributor

This pull request migrates OpenCATS database handling from MySQL utf8 to utf8mb4 so the application can store the full UTF-8 character range, including four-byte Unicode characters.

The runtime database charset configuration now uses utf8mb4, while application-level encodings such as HTML_ENCODING and AJAX_ENCODING remain unchanged as UTF-8. Installer-specific database connections also set the configured SQL character set before running installation queries.

Fresh installations now create the database schema with utf8mb4 and utf8mb4_unicode_ci. Existing installations are migrated through the current schema upgrade path, which updates the database default charset/collation and converts existing base tables to utf8mb4. Identifier quoting in the migration escapes backticks before generating ALTER DATABASE and ALTER TABLE statements.

The installation checks were updated to validate utf8mb4 support and regression coverage was added to verify that a string containing a four-byte Unicode character can be stored and read back unchanged through the database layer.

Legacy upgrade SQL files are intentionally left unchanged. This PR focuses on the current runtime configuration, fresh installation schema, installer behavior, current upgrade path and regression coverage.

Validation performed:

  • PHP syntax checks for the modified PHP files passed.
  • The new regression test was added for four-byte Unicode round-trip storage.
  • PHPUnit was not executed locally because the packaged checkout did not include an executable vendor/bin/phpunit.

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.

1 participant