propelorm/Propel2 — pull request #786 by oujesky (2014-10-19 19:33:30+00:00)
Title: String values in native ENUM column

Some RDBMS (e.g. MySQL) provides native ENUM column type. Propel however keeps using numeric values internally for the enumerated column even if you force the column type with `sqlType="ENUM('one', 'two', 'three')"` and `phpType="string"` in `schema.xml`.

Back in the day the solution was to modify the value set in Peer class (as discussed here: https://groups.google.com/forum/#!msg/propel-development/3DhvA-9bUDg/Q0Z3zY39DUkJ). With the advent of Peer classes, there is no such simple solution.

This PR modifies the behaviour of ENUM columns which are also set as native ENUM through `sqlType` attribute in schema by allowing the values actually inserted from Propel to database to be string.

The solution is bit hackish for my taste, but I am not very familiar with Propel internals, so I would use some guidance to see if there is a better place for doing this ENUM "magic".

Example column definition:

```xml

```

It would be also nice to have `sqlType` ENUM values automatically filled from `valueSet` to avoid repetition, but since this is RDBMS specific, I don't know how it fits in Propel's philosophy (Behavior?).