Answer the question
In order to leave comments, you need to log in
How to create autoincrement field in Laravel without marking primary key?
Good day.
Faced such a situation: I wanted to make 2 fields with autoincrement in the migration so that they change automatically. But it turned out that the autoincrement status implies a primary key. In Google I found a way to fix it through a SQL query.
Maybe there is some other way provided by the developers?
Answer the question
In order to leave comments, you need to log in
If you are only creating a field (e.g. unsigned integer)
$table->unsignedInteger('field', true);
$table->unsignedInteger('id', true)->change();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question