Conversation
Not sure the full list of RDBMS that Perpl supports, but Postgres definitely supports enums as well. Also, can you provide some example configs for enums? I see this in the tests: I'm a little confused on what the purpose of Also, I wanted to check that |
|
I also thought CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
CREATE TABLE person (
name text,
current_mood mood
);(from docs) Not sure if it makes sense to add this.
I used to get SET and ENUM confused all the time. No more after this.
Yes, this is still missing. |
|
Postgres had enums before MySQL did. It's a far more advanced database. But yes, you need to create them by adding a type, which is a proper way of doing it, since an enum can be used across multiple tables. I'm not sure how MySQL implemented them recently. I'd hope they have something similar to creating a type. Regarding SET, that's not really an enum to me. A column that's storing multiple "enum" values, isn't really a proper enum column. You don't get database level constraints on this type of design. I guess you could add "checks" in Postgres to help out. Anyway, IMO that shouldn't even be supported. But I guess it's already there. |
Introduces column types
ENUM_NATIVEandSET_NATIVE, which map to the MySQL ENUM and SET type.Old Propel
ENUMandSETtypes are now aliases for the newENUM_BINARYandSET_BINARYtypes. This mapping can be changed in perpl configuration file by setting thegenerator.defaultToNativeEnumeratedColumnTypestotrue.On platforms that have no native ENUM/SET type (all but MySQL), the
*_NATIVEtype resolves to the*_BINARYtype.ENUM_NATIVEis just a regular string column on PHP side, whileSET_NATIVEcolumns handles transformation between string representation in DB and array representation in PHP.see discussion in #97