Vapor 4/Fluent 中的自动模型迁移仍然存在吗?

Automatic model migrations in Vapor 4/Fluent still exist?

我正在尝试按照我的 Vapor 3 项目升级到 Vapor 4 的指南。我经常使用 Vapor 3 自动模型迁移。但是通过 Vapor 4 升级指南,他们不再被提及,事实上他们为每个模型使用特定的迁移。那么,他们不存在了吗?

据我所知有两种选择(感谢@vzsg)

  • you can pass an --auto-migrate parameter to the process (swift run Run serve --auto-migrate in the command line, and via Edit Scheme in Xcode)
  • you can manually call and wait for migrations try app.autoMigrate().wait()