Laravel migration rollback not working — tables remain unchanged #59537
-
|
I’m working on a Laravel project and I created several migrations. When I run everything works fine and the tables are created. php artisan migrateBut when I try to rollback : php artisan migrate:rollbacknothing happens — the tables are still there. Even when I run: php artisan migrate:resetthe database doesn’t change. Why is rollback not working, and how can I fix this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This happens because rollback only works if your migrations have a proper Solution:
|
Beta Was this translation helpful? Give feedback.
This happens because rollback only works if your migrations have a proper
down()method defined. By default, Laravel’s migration stubs include bothup()anddown(). If you only wrote theup()method and leftdown()empty, Laravel has no instructions on how to reverse the migration.Solution:
Check your migration files:
down()is missing or empty, rollback won’t drop the table.Run rollback again: