Tuesday, March 21, 2017

How to set auto increment into non primary key?

How would I set a database auto increment field that is not a primary key on the creation method?

The only way is using a raw query?

DB::statement('ALTER TABLE table CHANGE field field INT(10)AUTO_INCREMENT');



via Luiz

Advertisement