Reputation: 71
I wasn't able to create a migration even after following doc.
Upvotes: 1
Views: 391
Reputation: 150
Since the update (I don't know which, exactly), the flag -n
was replaced by -o
.
So, now you need to run.
typeorm migration:create -o path/to/my/migration
migration:create
doesn't work with specific datasources, so
I reccomend you to add two scripts in "scripts"
session at package.json
like the following:
default typeorm (that you will use for non-specific database stuff):
"typeorm": "ts-node-dev ./node_modules/typeorm/cli.js"
your custom typeorm (that you will use for your specific database stuff, like run & revert migrations):
"myTypeorm":"ts-node-dev ./node_modules/typeorm/cli.js -d path/to/my/ormconfig.ts"
Upvotes: 1