-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
When the primary key is composed of two columns, the command generation is also incorrect:
CREATE TABLE IF NOT EXISTS `alert_listener` (
`alert_listener_id` int(11) NOT NULL AUTO_INCREMENT,
`listener` varchar(250) DEFAULT NULL COMMENT 'Describes the listner (email address, phone number, ...).',
`listener_type` int(11) DEFAULT NULL,
`is_active` tinyint(1) DEFAULT NULL,
`entity_alert_id` int(11) NOT NULL,
PRIMARY KEY (`alert_listener_id`,`entity_alert_id`),
KEY `fk_alert_listener_device_alert1` (`entity_alert_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=815 ;
gives
$this->createTable(AlertListener::model()->tableName(),
array(
"alert_listener_id"=>"pk",
"listener"=>"varchar(250)",
"listener_type"=>"int(11)",
"is_active"=>"tinyint(1)",
"entity_alert_id"=>"int(11) NOT NULL",
"PRIMARY KEY (entity_alert_id)"
),
$options);
Metadata
Metadata
Assignees
Labels
No labels