Typeorm@0.3 不清楚有关迁移目录的发布文档

tev*_*vek 16 typeorm nestjs node.js-typeorm

我最近从 到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,然后将该文件名及其完整路径添加到数据源的迁移中?migrations: ['1652169197705-SomeMigration'...]

谢谢!

Jam*_*dge 3

是的,它确实 :)

我同意该文档需要认真对待,并且旧示例已更新,但其自述文件尚未更新 - 这导致了一些严重的混乱。