[eluser]Eric Barnes[/eluser]
I am trying to use the new dbforge to create a database. One issue that I can't seem to figure out is how to use the add_key to create a key on multiple fields.
Through straight mysql I am creating a table like this:
Code:
$sSQL = "CREATE TABLE `".$prefix."article2cat` (
`rel_id` bigint(20) NOT NULL auto_increment,
`article_id` bigint(20) NOT NULL default '0',
`category_id` bigint(20) NOT NULL default '0',
PRIMARY KEY (`rel_id`),
KEY `article_id` (`article_id`,`category_id`)
);
Through dbforge I have this:
Code:
$this->dbforge->add_field($fields);
$this->dbforge->add_key('rel_id', TRUE);
$this->dbforge->add_key('article_id');
$this->dbforge->create_table('article2cat');
But I don't see a way of creating a key for two columns.