我在我的 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)
但我什么也没收到。