NarHakobyan/awesome-nest-boilerplate

Error when running "yarn migration:generate migration_name"

Robotgeekk opened this issue · 4 comments

Hi,

I'm encountering an error when trying to run the command 'yarn migration:generate migration_name' in my project. The error message I'm receiving is:

$ typeorm-ts-node-esm migration:generate -d ormconfig migration_name No changes in database schema were found - cannot generate a migration. To create a new empty migration use "typeorm migration:create" command

I'm unsure of how to proceed in resolving this error. I've tried running the suggested command 'typeorm migration:create', but I'm not sure if this is the correct solution. Any help in resolving this issue would be greatly appreciated.

Thank you.

You can update typeorm to version 0.3.13-dev.58fc088

same question, and I run yarn add typeorm@0.3.13-dev.58fc088, the problem still exists

awesome-nest-boilerplate [main] % yarn migration:create migration_name   
yarn run v1.22.18
$ yarn run typeorm migration:create -d ormconfig migration_name
$ typeorm-ts-node-esm migration:create -d ormconfig migration_name
typeorm-ts-node-esm migration:create <path>

Creates a new migration file.

选项:
  -h, --help       显示帮助信息                                           [布尔]
  -o, --outputJs   Generate a migration file on Javascript instead of Typescript
                                                          [布尔] [默认值: false]
  -t, --timestamp  Custom timestamp for the migration name[数字] [默认值: false]
  -v, --version    显示版本号                                             [布尔]

无法识别的选项:d
✨  Done in 1.62s.

I changed it to "o", then it worked successfully.

typeorm changed the way how migrations wrok, you need to run

yarn migration:generate src/database/migrations/__name__