Search code examples
phplaravel

how to re-migrate a laravel migration after deleting the table


after I've manually deleted a table in mysql, I run the command:

php artisan migrate

and I get this:

Nothing to migrate.

it only works the first time, how to re-run the migration in laravel?


Solution

  • Laravel keeps a record of migrations that have been run. You need to go to the migrations table and delete the migration record. Laravel does this so that it knows which migrations have been run so that it doesn't run them again and so that in the case of a rollback, it knows the last batch of migrations which were done.

    This may help https://laravel.com/docs/5.6/migrations