You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: ENUM column cannot be used in any secondary/unique/composite index (v3.0.11 & 4.0-dev) #24729
Creating any non-primary index that includes an ENUM column fails — secondary, unique, and composite (ENUM at any position) are all rejected. ENUM columns themselves, enum filters, and enum validation work fine; only indexing them fails.
Steps to Reproduce
CREATETABLEt1 (id VARCHAR(191) PRIMARY KEY, role ENUM('a','b','c'), INDEX idx_role(role));
-- ERROR 20105 (HY000): not supported: ENUM column 'role' cannot be in secondary indexCREATETABLEt2 (id VARCHAR(191) PRIMARY KEY, role ENUM('a','b','c'), UNIQUE INDEX uq_role(role));
-- ERROR 20105 (HY000): not supported: ENUM column 'role' cannot be in unique indexCREATETABLEt3 (id VARCHAR(191) PRIMARY KEY, name VARCHAR(191), role ENUM('a','b','c'), INDEX idx(name, role));
-- ERROR 20105 (HY000): not supported: ENUM column 'role' cannot be in secondary index
Prisma impact
Any Prisma model with @@index/@@unique on an enum field fails to migrate. We had to remove 4 such indexes (e.g. users(workspace_id, role), branches(status)) from the schema + generated SQL.
Expected Behavior
MySQL allows ENUM columns in secondary and unique indexes.
Test context — Found while testing Prisma ORM (v5.22) compatibility against MatrixOne. Reproduced on both:
Prod cloud — 8.0.30-MatrixOne-v3.0.11
4.0 dev line — nightly-0bfda604 (select version() → 8.0.30-MatrixOne-v)
(Results on the older v3.0.5 are intentionally omitted.)
Activity