Just a repeat of what I had in the other thread, but it really didn’t fit in the other thread, so tossing it its own thread (sorry for hijacking!). I’m having major issues with adding a primary key through the Forge. Originally I was trying to use it with my massive install script, but I thought I’d simplify it to see if it was something in my script. Here is what’s in my controller:
$role_id = array(
'role_id' => array(
'type' => 'INT',
'constraint' => 6,
'auto_increment' => TRUE));
$this->dbforge->add_field($role_id);
$this->dbforge->add_key('role_id', TRUE);
$this->dbforge->create_table('roles', TRUE);
Running that returns the following errors:
Message: Array to string conversion
Filename: database/DB_driver.php
Line Number: 1206
Message: Array to string conversion
Filename: database/DB_driver.php
Line Number: 1215
Message: Array to string conversion
Filename: database/DB_driver.php
Line Number: 1291
Message: Array to string conversion
Filename: mysql/mysql_driver.php
Line Number: 438
Message: implode() [function.implode]: Invalid arguments passed
Filename: mysql/mysql_forge.php
Line Number: 158
The query it tries to spit out is:
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci' at line 3
CREATE TABLE IF NOT EXISTS `ci170_roles` ( `role_id` INT(6) AUTO_INCREMENT, PRIMARY KEY `role_id` () ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Any help would be awesome!
