我正在尝试完成一个简单的迁移 - 重命名用户表中的列。\n我无法获取 cli 来使用 migrationsDir 来创建或运行迁移。
\n\n迁移创造
\n\n当我运行 \n 时npm run typeorm:cli -- migration:create -n UserFullName -d \'server/migration,在迁移文件夹中创建文件没有问题。
创建不带 -d 参数的迁移只会在文件夹根目录中创建文件,它会忽略连接选项中的migrationsDir(请参阅下面的 ormconfig.ts)。
\n\n运行迁移
\n\n运行npm run typeorm:cli -- migration:run会产生退出状态 1,我的猜测是它找不到迁移,但我真的不知道。
Error during migration run:\nError: No connection options were found in any of configurations file.\n at ConnectionOptionsReader.<anonymous> (/Users/matthewshields/Documents/Code/Projects/Sumo/dohyo-dreams/src/connection/ConnectionOptionsReader.ts:41:19)\n at step (/Users/matthewshields/Documents/Code/Projects/Sumo/dohyo-dreams/node_modules/tslib/tslib.js:133:27)\n at Object.next (/Users/matthewshields/Documents/Code/Projects/Sumo/dohyo-dreams/node_modules/tslib/tslib.js:114:57)\n at fulfilled (/Users/matthewshields/Documents/Code/Projects/Sumo/dohyo-dreams/node_modules/tslib/tslib.js:104:62)\n at process._tickCallback (internal/process/next_tick.js:68:7)\n at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)\n at Object.<anonymous> (/Users/matthewshields/Documents/Code/Projects/Sumo/dohyo-dreams/node_modules/ts-node/src/bin.ts:157:12)\n at Module._compile (internal/modules/cjs/loader.js:689:30)\n at Object.Module._extensions..js …Run Code Online (Sandbox Code Playgroud)