laravel 如何查看迁移状态?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33803488/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 17:09:29  来源:igfitidea点击:

How to check migration status?

laravellaravel-5.1

提问by simo

In Rails, I can run:

在 Rails 中,我可以运行:

rake db:migrate:status

But how about Laravel? How would I know which migrations will run when I do:

但是 Laravel 呢?当我这样做时,我如何知道将运行哪些迁移:

php artisan migrate

I am on a production server, and I need to make sure that I won't break things.

我在生产服务器上,我需要确保我不会破坏东西。

回答by Bogdan

It's the exact same way with artisan, just add :status:

与 完全相同artisan,只需添加:status

php artisan migrate:status


In the future you can run just php artisanand it will list all available commands with a short description for each one. If you want more details about a command, like usage and what options it accepts, you can run php artisan help [command]. So for your command it would be:

将来你可以只运行它php artisan,它会列出所有可用的命令,并为每个命令提供一个简短的描述。如果您想了解有关命令的更多详细信息,例如用法和它接受的选项,您可以运行php artisan help [command]. 因此,对于您的命令,它将是:

php artisan help migrate:status