SQL ENUM and yiic shell "crud"

Hi

Currently, the "crud" command of the following table does not generate a form which shows "status" as a drop down:


CREATE TABLE IF NOT EXISTS `users` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `username` varchar(32) NOT NULL,

  `password` varchar(128) NOT NULL,

  `email` varchar(128) NOT NULL,

  `status` enum('active','confirmation','inactive','suspended') CHARACTER SET ascii COLLATE ascii_bin NOT NULL DEFAULT 'confirmation',

  PRIMARY KEY (`id`),

  KEY `status` (`status`)

) ENGINE=MyISAM  DEFAULT CHARSET=utf8;

How to create the table such that the generated pages and everything will take "enum" into account?

I’ve managed to do it by using


$schema = User::model()->getTableSchema()->getColumn('status')->dbType;

preg_match_all("/'([^']+)'/",$schema,$matches);

$matches = array_combine($matches[1],$matches[1]);

echo $form->dropDownList($model,'status',$matches);

But I wonder, is there no other, better way?