No matter what I do to my migration I keep getting this DB error:
[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
I think I understand entirely what the error means, however no amount of changes to my migration manages to fix the problem. I have tried to make "id" unique, set as primary, applied increments. I have also tried removing all the "unique" functions as well as all the "nullable". It always comes back the same.
I found this link on the web which apparently describes the problem and fix, but I am not sure what to do with it:https://github.com/laravel/framework/blob/master/src/Illuminate/Database/Schema/Blueprint.php#L354
anyway, here is my Schema:create
Schema::create('customers', function(Blueprint $table)
{
$table->increments('id');
$table->string('co_name',50);
$table->integer('company_tel',10)->unsigned();
$table->string('contact1_name',50);
$table->integer('contact1_tel',10)->unsigned();
$table->string('contact1_email',50);
$table->string('contact2_name',50)->nullable();
$table->integer('contact2_tel',10)->unsigned()->nullable();
$table->string('street',50);
$table->string('city',50);
$table->string('province',50);
$table->string('postcode',10);
$table->string('website')->nullable();
$table->string('notes')->nullable();
$table->timestamps();
});
As always Many Thanks !!