Laravel的工匠一言不发 [英] Laravel's Artisan says nothing to migrate
问题描述
我使用php artisan migrate:install
安装了迁移,然后使用php artisan migrate:make create_teams_table
命令创建了迁移.现在,我尝试使用根据官方文档
I installed migrations with php artisan migrate:install
then created a migration with the php artisan migrate:make create_teams_table
command. Now I try to run them with the following command that I made according to the official documentation:
php artisan migrate --path=app/foo/migrations/2014_01_21_143531_create_teams_table.php
这在控制台上为我提供了以下内容:
This gives me the following on the console:
没有什么可以迁移的.
Nothing to migrate.
数据库中的migrations
表为空,并且也不创建新表.我不明白为什么文档在路径中显示foo
. foo
是什么意思,它来自哪里?首先,我坚信该路径是错误的,原因是foo
,而且我知道该路径是相对于app
文件夹的,所以我将其更改为app/database/migrations
,但是它不起作用.我还尝试了很多其他路径组合,但没有一个起作用.
The migrations
table in the database is empty and the new table isn't created neither. I don't understand why the documentation says foo
in the path. What does foo
mean and where does it comes from? First I tought that the path is wrong because of the foo
thing and as I know the path is relative to the app
folder so I changed it to app/database/migrations
but it doesn't work. I also tried a lot of other path combination but none of them worked.
我输入了错误的路径吗?在这种情况下,控制台是否应该显示其他有用的消息? foo
是什么意思?如何运行我的迁移?
Did I entered the wrong path? In this case shouldn't the console show some other kind of helpfull message? What does foo
mean? How can I run my migration?
推荐答案
foo
只是一个例子. Laravel默认会寻找要在app/database/migrations
中运行的迁移.尝试删除该--path
参数,看看它是否有效.
That foo
thing is just an example. Laravel will look for migrations to run in app/database/migrations
on default. Try removing that --path
parameter and see if it works.
这篇关于Laravel的工匠一言不发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!