如学说迁移帮助说:
Or you can also execute the migration without a warning message which you need to interact with:
./bin/console doctrine:migrations:migrate --no-interaction
我尝试通过命令运行当前的迁移版本:
./bin/console doctrine:migrations:migrate current --no-interaction
尽管如此,我总是得到一个错误:
WARNING! You have 1 previously executed migrations in the database that are not registered migrations.
>> 2020-01-29 13:03:03 (20200129130303)
No migrations to execute.
当然,我清楚地知道“我以前执行过1次迁移”。我的目标是无需任何交互即可执行特定的旧版本。我该如何实现?
如果您不想看到任何输出,则应使用--quiet, -q
标志。
交互是Symfony询问您Are you sure you want to execute migrations?
(或任何消息内容),然后您以y
或n
回答。省略此部分并带有--no-interaction
标志。