seppevs / migrate-mongo

A database migration tool for MongoDB in Node
MIT License
926 stars 163 forks source link

Use migrationFileExtension for sample-migration #317

Closed noisyscanner closed 3 years ago

noisyscanner commented 3 years ago

Describe the bug If I set migrationFileExtension to .ts for TypeScript, I would expect it to load sample-migration.ts instead of sample-migration.js

To Reproduce Steps to reproduce the behavior:

  1. Create a sample migration file at migrations/sample-migration.ts
  2. Set migrationFileExtension to .ts in migrate-mongo-config.js
  3. Run mirate-mongo create migrationName

Expected behavior Migration to be created using template at migrations/sample-migration.ts

Actual behavior Migration not created using template - the default built-in template is used instead

Additional context Another potential solution could be the abilit to specify sampleMigrationFileName or something in migrate-mongo-config.js

seppevs commented 3 years ago

Resolved by merging this PR