medium-nest-typeorm-postgres-sample icon indicating copy to clipboard operation
medium-nest-typeorm-postgres-sample copied to clipboard

How I can create migrations with this realisation?

Open OliverVarnce opened this issue 3 years ago • 0 comments

I`m trying to create migration by TypeORM CLI

npm run typeorm -- -d ./dist/shared/typeorm/typeorm.service.js migration:generate ./src/shared/typeorm/migrations/$npm_config_name

but have an error:

`Error during migration generation: Error: Unable to open file: "/Users/admin/Desktop/sample/dist/shared/typeorm/typeorm.service.ts". Cannot find module '/Users/admin/Desktop/sample/dist/shared/typeorm/typeorm.service.ts' Require stack:

  • /Users/admin/Desktop/sample/node_modules/typeorm/util/ImportUtils.js
  • /Users/admin/Desktop/sample/node_modules/typeorm/commands/CommandUtils.js
  • /Users/admin/Desktop/sample/node_modules/typeorm/commands/SchemaSyncCommand.js
  • /Users/admin/Desktop/sample/node_modules/typeorm/cli.js at Function.loadDataSource (/Users/admin/Desktop/sample/node_modules/src/commands/CommandUtils.ts:22:19) at async Object.handler (/Users/admin/Desktop/sample/node_modules/src/commands/MigrationGenerateCommand.ts:73:26)`

OliverVarnce avatar Aug 25 '22 10:08 OliverVarnce