DARK MODE 

Posted on Friday, December 31, 2021 by

How I Solve 'SQLSTATE[HY000]: General error: 1 table already exists' Error in Tinker

 


I received this error when I tried to run migration. The fix:

Schema::drop('profiles')

This command will deletes the data of the affected table and removes the entire schema/structure of the table from the database. This error happened because there was an error in the table. I remember I inserted a value to a table but not assign it to any of the column and received a PHP warning. When I run php artisan migration again, there is no more error. 


Helpful links 🔗

  1. https://stackoverflow.com/a/39519031/11735769
  2. https://afteracademy.com/blog/what-is-the-difference-between-truncate-delete-and-drop-statements

No comments:

Post a Comment