laravel 4 artisan -- 如何回滚到特定的迁移状态?

2022-01-08 00:00:00 migration php laravel laravel-4

假设我得到了 a.phpb.phpc.phpd.php 迁移类文件.如何回滚到特定的迁移状态,例如在 b.php 中定义的状态,使用 artisan 命令?

Say i got a.php, b.php, c.php and d.php migration classes files. How to rollback to a specific migration state, the state defined within b.php for example, with artisan command ?

推荐答案

Laravel 5.3

使用 Laravel 5.3,无需编写繁重的脚本.因为它允许回滚给定数量的迁移.

Laravel 5.3

With Laravel 5.3 there is no need for heavy scripting. As it allows to rollback given number of migrations.

php artisan migrate:rollback --step=1

这是手册页面供参考.

相关文章