【问题标题】:Typeorm@0.3 unclear release documentation about migrations dirTypeorm@0.3 关于迁移目录的发布文档不清楚
【发布时间】:2022-07-07 01:31:39
【问题描述】:

我最近从typeorm@0.2 移动到版本0.3 并且在发布的文档中有这句话:https://github.com/typeorm/typeorm/releases/tag/0.3.0 这对我来说没有多大意义(在DEPRECATED 的部分下):

entities, migrations, subscribers options inside DataSourceOptions accepting string directories support is deprecated. You'll be only able to pass entity references in the future versions.

从这里我知道我们现在必须指定实体并且不能使用(或者更好地说,将来不能使用)通配符路径,即entities: ['dist/**/*.entity.{ts,js}'],而我们必须使用:entities: [User, AnoherEntity...]

但这也适用于migrations 吗?我觉得这很令人困惑,因为迁移是由 typeorm 的 cli 生成的,这意味着我们必须生成迁移,即1652169197705-SomeMigration,然后将该文件名及其完整路径添加到 DataSource 的迁移中? migrations: ['1652169197705-SomeMigration'...]

谢谢!

【问题讨论】:

    标签: nestjs typeorm node.js-typeorm


    【解决方案1】:

    我认为你应该阅读 this 我关注这个并且我做到了,希望它对你有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-16
      • 2022-07-25
      • 1970-01-01
      • 2021-05-23
      • 2021-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多