Eli
Eli

Reputation: 1276

Laravel database migration methods not working after deleting a migration file

I am just beginning to learn laravel and so I am constantly dealing with migration methods right now. Previously, I have deleted a migration file ShippedViaToPurchaseOrders and after that I cannot perform php artisan migrate:reset/rollback anymore. What is the problem with this? Please help. Please take a look with the error below. Thank you so much.

enter image description here

Upvotes: 0

Views: 354

Answers (1)

Jerodev
Jerodev

Reputation: 33186

These files are loaded using composer, it still thinks the file is there.

Try running the composer dump-autoload command before running migrations to recreate the autoload file and let composer know the file is no longer there.

Update:

The Laravel migration tool creates a table migrations in your database to know what migrations have been executed. In this table, remove the row corresponding to the removed migration.
Because the row is still there, Laravel will keep trying to run the rollback migration corresponding to that row.

Upvotes: 1

Related Questions