Collation inconsistency: saved_filters and ticket_attachments use utf8mb4_unicode_ci instead of the documented utf8mb4_general_ci convention #41

Open
opened 2026-08-31 21:29:46 -04:00 by jared · 0 comments
Owner

Severity: Medium

README.md Developer Notes #12 states: "Database collation: Use utf8mb4_general_ci (not unicode_ci) for new tables." But in migrations/000_baseline.sql, saved_filters (~line 158) and ticket_attachments (~line 188) both use utf8mb4_unicode_ci, inconsistent with every other table in the schema.

Mixed collations on the same charset don't break anything by themselves today, but any future query that joins/compares these columns against general_ci columns will need explicit COLLATE casts or will hit "Illegal mix of collations" errors.

Fix: Add a migration to convert both tables' text columns to utf8mb4_general_ci for consistency with the rest of the schema and the documented convention.

**Severity:** Medium README.md Developer Notes #12 states: "Database collation: Use `utf8mb4_general_ci` (not `unicode_ci`) for new tables." But in `migrations/000_baseline.sql`, `saved_filters` (~line 158) and `ticket_attachments` (~line 188) both use `utf8mb4_unicode_ci`, inconsistent with every other table in the schema. Mixed collations on the same charset don't break anything by themselves today, but any future query that joins/compares these columns against `general_ci` columns will need explicit `COLLATE` casts or will hit "Illegal mix of collations" errors. **Fix:** Add a migration to convert both tables' text columns to `utf8mb4_general_ci` for consistency with the rest of the schema and the documented convention.
jared added the data-integritypriority/medium labels 2026-09-08 10:15:44 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#41