删除迁移导致异常

Deleting migrations results in an Exception

在我的应用程序中,当我 运行 php artisan migrate:make create_location_user_table 时,然后删除生成的文件(如果我删除在 vendor/composer/autoload_classmap.php 中创建的行并不重要, php artisan migrate:refresh 命令抛出错误:

include(<path_to_project>/database/migrations/2015_06_21_105357_create_location_user_table.php): failed to open stream: No such file or directory

在 运行ning 命令删除错误的自动加载条目后,我得到一个异常。我试过的命令是:composer updatecomposer dump-autoloadphp artisan clear-compiledphp artisan optimize.

PHP Fatal error:  Class 'CreateLocationUserTable' not found in <path_to_project>\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php on line 323

[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'CreateLocationUserTable' not found

手动进入您的 mysql 数据库 (PHPMyAdmin) 并删除迁移 table。按照您在上面采取的步骤并执行此操作应该可以解决您的问题