Hacker News new | ask | show | jobs
by yxhuvud 4573 days ago
Considering the sad state of mysql enums with the pitfalls it have, it really isn't a shame.

I totally agree that a text column would have been preferable though.

1 comments

Shouldn't the mapping to database be backend-dependent anyway? SQLite has more or less no feature, yet ORMs don't feel the need to restrict themselves to what sqlite can do.

(nota: oracle and mssql don't, afaik, have an enum type either)

(and in Postgres, enum is not a type, it's a type constructor. First you have to `CREATE TYPE yourtype AS ENUM ( values... )` then you can use `yourtype` in a table, you can't have a column of type `ENUM ( whatever )` because Postgres enums are disjoint and not structurally equivalent)