seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
931 stars 166 forks source link

Make migration file extension configurable #194

Closed rryanrussell closed 4 years ago

rryanrussell commented 4 years ago

I use typescript and can run migrate-mongo through ts-node, but the module file extension is hard-coded. This PR makes it a config option that defaults to .js. The config option is used when create is called and when getting migration directory listing.

Checklist
coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling ecc48fbb29ff3cf76aaaa23c8973ec1eae8b83f9 on rryanrussell:master into e4216989d7b52aa232664fc095e902b064dd70ac on seppevs:master.

seppevs commented 4 years ago

Landed in migrate-mongo v7.2.0 🎉
Thank you for your contribution!

leshiple commented 3 years ago

@rryanrussell , how to run migrate-mongo through ts-node ?

rryanrussell commented 3 years ago

@leshiple Wrote it a long time ago so I don't know if it will still work on the current version, but here's my package.json script entry

"migrate": "node -r tsconfig-paths/register -r ts-node/register node_modules/migrate-mongo/bin/migrate-mongo.js"

Use it with npm run migrate up etc