Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Migration files with *.ts extension #60

Open
mkovel opened this issue Mar 26, 2020 · 4 comments
Open

Support Migration files with *.ts extension #60

mkovel opened this issue Mar 26, 2020 · 4 comments

Comments

@mkovel
Copy link

mkovel commented Mar 26, 2020

Hey, we use Typescript + Mongoose in our project and tried use migrate-mongoose for adding migrations. But migrate-mongoose filtering files by reg-pattern, /\d{13,}\-.+.js$/.test(file)) can we change a little /\d{13,}\-.+.(j|t)s$/.test(file)). Or create new config param for this.
Thanks

@pavel-lens
Copy link

I would appreciate support for Typescript files as well 👍

@troywweber7
Copy link

This day and age, Typescript is so popular and support is incredibly easy to add it's rare to find a relevant project that doesn't support it even if it's just via a definition file. Hopefully this makes it into the next release!

@andrewmartin
Copy link

Same here, curious if you can somehow allow parsing of the files using ts-node.

@longseespace
Copy link

Same here, curious if you can somehow allow parsing of the files using ts-node.

Here is how I did it:

"scripts": {
  "migrate_prod": "migrate up --autosync",
  "migrate_dev": "ts-node ./node_modules/migrate-mongoose/src/cli.js up --autosync"
}

On development machine, use npm run migrate_dev. On production server, you need to compile the project into .js code then run migrate_prod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants