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" 1

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”

$table->integer('thnajrn_id', 10)->unsigned();
to
$table->integer('thnajrn_id')->unsigned();
or try
table->integer('thnajrn_id')->length(10)->unsigned();

Here is what the above code is Doing:
1. It’s creating a new migration file.
2. It’s adding a new column to the users table.
3. It’s making the column an integer.
4. It’s making the column unsigned.
5. It’s making the column 10 characters long.

Similar Posts