我想用下面的元素迁移一个表.
public function up() {
Schema::create('users', function(Blueprint $table) {
$table->increments('id');
$table->integer('LoginID', 9)->unsigned();
$table->string('username');
$table->string('email')->unique();
$table->string('password', 60)->unique();
$table->rememberToken();
$table->timestamps();
});
}
Run Code Online (Sandbox Code Playgroud)
但是,我一直在处理下面的错误.有谁知道如何使整数"LoginID不是主键,以便我可以迁移下面的表?任何建议赞赏.提前谢谢.
[Illuminate\Database\QueryException]
SQLSTATE [HY000]:一般错误:1表"users"有多个主键(SQL:create table"users"("id"整数not null主键自动增量,"LoginID"整数不是null主键autoincrement,"username"varchar not null,"email"varchar not null,"password"varchar not null,"remember_token"varchar null,"created_at"日期时间不为空,"updated_at"datetime not null))