I keep getting error while migrating in Laravel
[PDOException] SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key
Code
public function up()
{
Schema::create('inventories', function($table){
$table->engine = 'InnoDB';
$table->increments('id')->unsigned();
$table->string('sku',255);
$table->string('description', 255 )->nullable;
$table->tinyInteger('stock',5)->nullable()->unsigned();
$table->tinyInteger('day_of_week',1)->unsigned();
$table->text('note')->nullable();
$table->timestamps();
});
}
unsigned()
.increments()
does that already. However I doubt this causes the error... – lukasgeiter