migrate command on laravel 5.1 console

时间:2016-08-31 12:34:36

标签: php mysql laravel-5.1 database-migration

I have created many tables use migration file, but I have dropped some table via the mysql command line tool, then I find the migration status about the tables I have dropped is still ran, so how can i fix it?

When I use migrate command, it always says nothing to migrate, but I have no table in my database.

I have tried to delete all the logs and stuff under the storage path.

I have also tried to delete the migration table on mysql or change .env file to use a new database, but both cannot work. Can anyone help me?

I use laravel 5.1.

1 个答案:

答案 0 :(得分:0)

`Run migrate:rollback (to undo the last migration)

If migrate:rollback doesn't work ; do it manually:
step 1 : delete the migration file
step 2 : composer dump-autoload (for resetting autoload file)
step 3 : remove the last entry from migration(to modify your database)`
  

虽然您在数据库中没有现有表,但您无法迁移的原因是因为您之前的迁移仍然存在。清除历史记录或执行上述步骤