SQLSTATE: Syntax error or access violation: 1091 Can't DROP 'posts_user_id_foreign'; check that column/key exists
Error SQLSTATE: 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
- Call to a member function pluck() on array
- Laravel delete all rows older than 30 days
- How to call Laravel route in jQuery
- How to add active class to menu item in laravel
- How to restore deleted records in laravel
- How to delete record in Laravel with ajax
- How to get date from created_at field in laravel
- How to get random string in Laravel
- Retain selected value of select box in Laravel
- Extract only time from datetime in laravel
- Permission denied error while creating storage link in Laravel
- Where to use whereNotNull eloquent in laravel
- Get all users except the followings users in overtrue laravel-follow
- How to create laravel project using composer
- Laravel save object to database
- Get last year created records in Laravel
- How to include header file in laravel
- Use withCount() to get total number of records with relationship
- Laravel create multiple records in Pivot table
- Delete file from amazon s3 bucket using Laravel
- Pagination in laravel
- How to check find method executed successfully in laravel
- Permanently delete a record in laravel
- Remove several global scope from query
- Laravel insert query not working