小编tev*_*vek的帖子

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

我最近从 到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'...]

谢谢!

typeorm nestjs node.js-typeorm

16
推荐指数
1
解决办法
4717
查看次数

标签 统计

nestjs ×1

node.js-typeorm ×1

typeorm ×1