SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'posts_user_id_foreign'; check that column/key exists
Error SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'posts_user_id_foreign'; check that column/key exists occurs when you try to delete the foreign key which does not already exist in your table.
-
Check constraints name 'posts_user_id_foreign' exists or not in SQL
SELECT `TABLE_SCHEMA`, `TABLE_NAME` FROM `information_schema`.`KEY_COLUMN_USAGE` WHERE `CONSTRAINT_NAME` IN ('posts_user_id_foreign')
You can use the SQL query to check the CONSTRAINT_NAME 'posts_user_id_foreign' exists or not.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Don't forget to share this article! Help us spread the word by clicking the share button below.
We appreciate your support and are committed to providing you valuable and informative content.
We are thankful for your never ending support.
Random Code Snippet Queries: Laravel
- Convert input array to comma-separated string in laravel controller
- How to get CSRF token in laravel controller
- How to customize pagination view in laravel
- How to call Laravel route in jQuery
- How to display 1 day ago in comments in laravel view
- Call to undefined relationship [user] on model [App\Models\Post]
- How to display order by null last in laravel
- Create project table with model and migration
- How to get last year records count with month wise in Laravel
- How to display HTML tags In Laravel blade
- Retain selected value of select box in Laravel
- Save or update pivot table data with additional column in Laravel
- Laravel recursive function in controller
- Import/Use Storage facade in laravel
- How to prevent host header attack in Laravel
- Method Illuminate\Events\Dispatcher::fire does not exist
- How to get the id of last record from collection object in laravel view
- Extra Filter Query on Relationships in Laravel
- How to pass query string with pagination in laravel
- Composer\Exception\NoSslException
- How to pass data to route in laravel?
- How to check column value of a record is null or not in laravel
- How to return a column with different name in Laravel
- How to check if user has created any post or not in laravel
- Generate unique username in Laravel