php oil generate scaffold user username:string password:string email:string profile_fields:text group:integer[11] last_login:integer[20] login_hash:stringbut when i
php oil r migrateit suddenly outputs an error:
Error - SQLSTATE[42000]: Syntax error or access violation: 1064 You have an erro
r in your SQL syntax; check the manual that corresponds to your MySQL server ver
sion for the right syntax to use near 'group int(11) NOT NULL,
last_login int(20) NOT NULL,
login_hash varchar(255) N' at line 7 with query: "CREATE TABLE IF NOT EX
ISTS users (
id int(11) NOT NULL AUTO_INCREMENT,
username varchar(255) NOT NULL,
password varchar(255) NOT NULL,
email varchar(255) NOT NULL,
profile_fields text NOT NULL,
group int(11) NOT NULL,
last_login int(20) NOT NULL,
login_hash varchar(255) NOT NULL,
created_at int(11) NOT NULL,
updated_at int(11) NOT NULL,
PRIMARY KEY id (id)
) DEFAULT CHARACTER SET utf8;" in COREPATH/classes/database/pdo/connection.php o
n line 137
namespace Fuel\Migrations;
class Create_users {
public function up()
{
\DBUtil::create_table('users', array(
'id' => array('constraint' => 11, 'type' => 'int', 'auto_increment' => true),
'username' => array('constraint' => 255, 'type' => 'varchar'),
'password' => array('constraint' => 255, 'type' => 'varchar'),
'email' => array('constraint' => 255, 'type' => 'varchar'),
'profile_fields' => array('type' => 'text'),
'group' => array('constraint' => 11, 'type' => 'int'),
'last_login' => array('constraint' => 20, 'type' => 'int'),
'login_hash' => array('constraint' => 255, 'type' => 'varchar'),
'created_at' => array('constraint' => 11, 'type' => 'int'),
'updated_at' => array('constraint' => 11, 'type' => 'int'),
), array('id'));
}
public function down()
{
\DBUtil::drop_table('users');
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!