【问题标题】:CakePHP 3 Skip Migration in ProductionCakePHP 3 在生产环境中跳过迁移
【发布时间】:2017-10-08 15:34:34
【问题描述】:

在执行了几个无法再次执行的命令后,我的迁移在生产中失败,有没有办法跳过迁移?

【问题讨论】:

  • 如果可以访问数据库,将迁移添加到phinxlog表中。

标签: cakephp cakephp-3.x cakephp-3.4 phinx


【解决方案1】:

有一个 mark_migrated 命令可用于将特定迁移设置为已迁移,这会将它们标记为不需要运行。 CakePHP Documentation

您可以使用以下内容,其中 target 是您不想标记为不需要运行的迁移的时间戳。

bin/cake migrations mark_migrated --target=20151016204000

【讨论】:

  • 请注意,此命令将运行 all 迁移到目标(包括目标)。如果您想挑选一个迁移来标记为已迁移,只需将--only 作为附加参数添加到@KaffineAddict 的代码示例(这也在链接到的文档中)。
猜你喜欢
  • 2019-11-14
  • 1970-01-01
  • 2017-01-25
  • 1970-01-01
  • 2014-07-27
  • 2016-02-17
  • 2020-05-14
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多