Laravel 表:只能有一个 auto 列,并且必须将其定义为键
我已经使所有整数无符号,但我仍然得到错误。我需要更改哪些内容?
<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateFacebook extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facebook', function($table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->timestamps();
$table->string('username', 255);
$table->bigInteger('uid', 20)->unsigned();
$table->string('access_token', 255);
$table->string('access_token_secret', 255);
$table->string('photoURL', 255);
$table->string('profileURL', 255);
$table->string('firstName', 255);
$table->string('lastName', 255);
$table->string('gender', 255);
$table->string('age', 20);
$table->integer('birthDay')->unsigned();
$table->integer('birthMonth')->unsigned();
$table->integer('birthYear')->unsigned();
$table->string('email', 255);
$table->string('phone', 30);
$table->string('address', 255);
$table->string('country', 100);
$table->string('region', 100);
$table->string('city', 100);
$table->string('zip', 20);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facebook');
}
}
SQLSTATE[42000]:语法错误或访问违规:1075表定义不正确;只能有一个 auto 列,并且必须将其作为键进行 de 罚款
谢谢。