On Mon, 6 Nov 2006, Josef Karthauser wrote:

Is it possible to extract a list of possible values for an enumerated
type using DBIx?  I think that this is possible in Class::DBI, so I
expect it's possible here too, but I can't find it in the docs.


Not currently, but if you do add them, I suggest you use the format that SQL::Translator supports, in the column_info, so that deploy() just works.

-> add_columns( 'enumfieldname' => {
     data_type => 'enum',
     extra => { 'list' => ['red', 'green', 'blue'] }
   });

- Currently this is mysql-only, and if you're lucky, the other producers will convert mysql enum types to normal fields with constraints..

NB You can also set: 'binary', 'unsigned', 'zerofill', 'character set', 'collate', 'on update' in the extras data for mysql.

Jess


_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to