Repository navigation
Schema synchronization now keeps TypeEnum columns in sync with the model. Adding a value to an enum no longer requires a manual ALTER TABLE: synchronize() reconciles existing columns.
MySQL
- Reads
INFORMATION_SCHEMA.COLUMNS.COLUMN_TYPEand runsALTER TABLE ... MODIFY COLUMNwhen the values differ - Column attributes (
NOT NULL,DEFAULT) are re-applied, because MySQL requires the full definition - Labels are compared exactly, so a case-only difference is applied too — a case-sensitive collation would otherwise keep rejecting the model spelling
PostgreSQL
- Replaces the
CHECKconstraint generated for the enum (TEXT+CHECK) - The constraint is identified through
pg_constraint.conkey/pg_attribute, never by matching text in its definition - Only standalone single-column enum predicates are replaced; compound and unrelated rules are preserved
- Drop and add happen in a single
ALTER TABLE, so a newCHECKthat rejects existing rows leaves the old one in place
Opt-out
- New
synchronize(syncEnumValues: false)for large tables where theALTERshould be scheduled
Also
TableSyncronizernow also readsDATA_TYPE/COLUMN_TYPEfromINFORMATION_SCHEMA- Integration tests run against MySQL 8.0 and PostgreSQL 14 in CI
Upgrade: queryflow: ^0.8.0. No API breaks — existing databases may run a single ALTER on the first synchronization after upgrading when a model enum had drifted from the database.