【发布时间】:2015-05-07 20:40:23
【问题描述】:
尝试运行以下迁移时:
Schema::create('languages', function(Blueprint $table){
$table->increments('id');
$table->string('lang', 10);
$table->string('name', 50);
$table->integer('active', 2);
$table->timestamps();
});
我收到以下错误:
there can be only one auto column and it must be defined as a key
但 laravel 的文档指出:$table->increments('id'); Incrementing ID to the table (primary key)
知道如何处理吗? 提前致谢!
【问题讨论】:
标签: php mysql laravel laravel-4