
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
- Pass variable from blade to controller Laravel
- Create project table with model and migration
- How to display HTML tags In Laravel blade
- Ignore Records where a field has NULL value in Laravel
- How to create static page in Laravel
- How to avoid duplicate entries in pivot table in Laravel
- How to pass data to multiple partial view files in laravel
- Get latest record by created at in Laravel
- How to fill a column automatically while creating records in Laravel
- Insert data with form validation using ajax in laravel
- How to start websocket server in laravel
- How to validate form input data in laravel
- Wheredate in laravel not working
- How to run a specific seeder class in laravel
- How to send ID to another page in Laravel
- Store logged in user details in session and display in view in laravel
- Send post data from controller to view
- Laravel hasmany select not working
- Conditional validation in laravel
- Get content from web URL in laravel
- SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'user_id'
- Import/Use Storage facade in laravel
- How to get file extension from input type file in laravel
- Print query in laravel
- In order to use the Auth::routes() method, please install the laravel/ui package