Laravel 迁移已删除文件
Laravel Migrations Deleted File
我正在研究 Laracasts Laravel 5 基础知识,但是当再次进行 运行 迁移时,我发现我有重复的迁移,此时我想 - 我应该删除它。所以我做了……然后开始了我的问题。
当我现在尝试加载迁移时,出现以下错误:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
然而,当我检查我的数据库时(请注意,我已经删除并重新创建它以解决我的问题)并且在 mirgations 中只有两条记录 table:
vagrant@homestead:~/Code/Laravel$ sqlite3 storage/database.sqlite
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
sqlite> select * from migrations;
2014_10_12_000000_create_users_table|1
2014_10_12_100000_create_password_resets_table|1
sqlite>
任何帮助将不胜感激,如果我是个白痴并且遗漏了一些明显的东西,请随时指出。
谢谢!
第一个错误:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
应该固定执行 composer dump-autoload
.
关于第二个:"However when I checked my database (Note that I have deleted and recreated it in order to combat my issue) and there are only two records in the mirgations table:"
正如您所说,您已经重新创建了它,但出现了错误,因为没有 migrations table,删除它并重新构建它
rm storage/database.sqlite
touch storage/database.sqlite
php artisan migrate:install
php artisan migrate
请试试,这个帮我解决了问题
composer dump-autoload
谢谢
我正在研究 Laracasts Laravel 5 基础知识,但是当再次进行 运行 迁移时,我发现我有重复的迁移,此时我想 - 我应该删除它。所以我做了……然后开始了我的问题。
当我现在尝试加载迁移时,出现以下错误:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
然而,当我检查我的数据库时(请注意,我已经删除并重新创建它以解决我的问题)并且在 mirgations 中只有两条记录 table:
vagrant@homestead:~/Code/Laravel$ sqlite3 storage/database.sqlite
SQLite version 3.8.6 2014-08-15 11:46:33
Enter ".help" for usage hints.
sqlite> select * from migrations;
2014_10_12_000000_create_users_table|1
2014_10_12_100000_create_password_resets_table|1
sqlite>
任何帮助将不胜感激,如果我是个白痴并且遗漏了一些明显的东西,请随时指出。
谢谢!
第一个错误:
[ErrorException]
include(/home/vagrant/Code/Laravel/database/migrations/2015_05_24_211527_create_articles_table.php): failed to
open stream: No such file or directory
应该固定执行 composer dump-autoload
.
关于第二个:"However when I checked my database (Note that I have deleted and recreated it in order to combat my issue) and there are only two records in the mirgations table:"
正如您所说,您已经重新创建了它,但出现了错误,因为没有 migrations table,删除它并重新构建它
rm storage/database.sqlite
touch storage/database.sqlite
php artisan migrate:install
php artisan migrate
请试试,这个帮我解决了问题
composer dump-autoload
谢谢