
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
- Get the post details if it has at least one comment in comments table
- Method Illuminate\Events\Dispatcher::fire does not exist
- Check if Relationship Method Exists in Laravel
- Update record after find method in lavavel
- Get last week data in Laravel
- How to display HTML tags In Laravel blade
- How to get user information using hootlex/laravel-friendships package in laravel
- How to remove P tag from CkEditor in Laravel?
- Print last executed query in laravel
- How to remove package from laravel
- How to check duplicate entry in laravel
- Laravel route parameter
- Convert input array to comma-separated string in laravel controller
- How to Access Array in blade laravel
- Laravel 5.4 save data to database
- Create record with unique slug in laravel
- Redirect to previous page or url in laravel
- Use of undefined constant laravel
- Show old value while editing the form in Laravel
- Count all and get 10 records after where condition in laravel
- Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587 (Connection refused)"
- How to print form data in laravel
- Laravel route redirect not working
- Get ids in array from users table
- Display message with session flash using bootstrap alert class in laravel