[eluser]Unknown[/eluser]
I want create table with multiple primary keys.
Example, I want create this table using dbforge:
CREATE TABLE `test` (
`id_user` int(11) NOT NULL default '0',
`id_record` int(11) NOT NULL default '0',
`id_option` int(11) NOT NULL default '0',
`description` varchar(128) NOT NULL default '',
PRIMARY KEY (`id_user`,`id_record`,`id_option`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
$fields = array(
'id_user' => array('type' => 'INT', 'default' => '0', 'constraint' => '11'),
'id_record' => array('type' => 'INT', 'default' => '0', 'constraint' => '11'),
'id_option' => array('type' => 'INT', 'default' => '0','constraint' => '11'),
'description' => array('type' => 'VARCHAR', 'default' => '', 'constraint' => '128')
);
$this->dbforge->add_field($fields);
$this->dbforge->add_key('id_user', true);
$this->dbforge->add_key('id_record', true);
$this->dbforge->add_key('id_option', true);
$this->dbforge->create_table('test', true);
error at primary key creation. How it is possible to create such primary key using db_forge?