小编iY1*_*1NQ的帖子

在运行“typeorm migration:run”之前有什么方法可以获取挂起的迁移吗?

我在我的 Nest 应用程序上运行以下行:

import * as typeOrm from "../node_modules/typeorm/index";

bootstrap(){

    // ...

    const typeOrmConnection = typeOrm.getConnection();
    typeOrmConnection.runMigrations();
    logger.debug("Pending migrations executed");

}
Run Code Online (Sandbox Code Playgroud)

这正在成功执行挂起的迁移,但我想在“runMigrations()”之前/之后在日志跟踪上打印它们,有什么方法可以做到吗?

我试图获得以下回报:

const executedMigrations = await typeOrmConnection.runMigrations();
Run Code Online (Sandbox Code Playgroud)

但我什么也没收到。

migration typeorm nestjs

4
推荐指数
1
解决办法
4012
查看次数

标签 统计

migration ×1

nestjs ×1

typeorm ×1