
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 have got this error while migrating a migration file in Laravel to create a tiny integer column.
$table->tinyInteger('order_by', 4)->after('status')->nullable();
Answers 1
-
Create tiny integer column in Laravel using migration
//Change from $table->tinyInteger('order_by', 4)->after('status')->nullable(); //To $table->tinyInteger('order_by')->after('status')->nullable();
1
Random Code Snippet Queries: Laravel
- How to get laravel errors folder in views directory in laravel
- Convert multidimensional array to single array in Laravel
- Remove array keys and values if it does not exist in other array in Laravel
- How to get user information using hootlex/laravel-friendships package in laravel
- Touch parent updated_at in Laravel
- Illuminate\Database\QueryException could not find driver
- Get duplicate records in laravel
- Laravel create default admin user
- Get last year created records in Laravel
- How to pass data to multiple partial view files in laravel
- Method Illuminate\Http\Request::validated does not exist
- How to add script on specific view file in laravel while extending layout
- Php artisan make model, factory, migration and controller in single command
- SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table
- How to get list of all views file in laravel
- Automatically remove records using Prunable trait in Laravel
- After image selected get validation error in laravel
- How to get images from AWS s3 and display in Laravel blade
- Call to a member function pluck() on array
- Convert input array to comma-separated string in laravel controller
- Extract only time from datetime in laravel
- How to display order by null last in laravel
- Composer\Exception\NoSslException
- Method Illuminate\Database\Eloquent\Collection::lists does not exist
- How to prevent host header attack in Laravel