删除迁移会导致异常

时间:2015-06-21 11:08:23

标签: php laravel laravel-5 composer-php autoload

在我的应用程序中,当我运行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

运行命令以摆脱错误的自动加载条目后,我得到一个例外。我尝试过的命令是: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

1 个答案:

答案 0 :(得分:2)

手动进入mysql数据库(PHPMyAdmin)并删除迁移表。通过上面的步骤,这样做可以解决您的问题