Skip to content

Commit

Permalink
Merge pull request #366 from d-tsaruk/feature/migration-filetype
Browse files Browse the repository at this point in the history
Fixed getMigration filetype for built versions
  • Loading branch information
ilovepixelart authored Dec 12, 2024
2 parents e84f5e9 + 4e8ffe1 commit 042ac8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,11 @@ class Migrator {
}> {
const files = fs.readdirSync(this.migrationsPath)
const migrationsInDb = await this.migrationModel.find({}).exec()

const fileExtensions = ['.ts', '.js']

const migrationsInFs = files
.filter((filename) => /^\d{13,}-/.test(filename) && filename.endsWith('.ts'))
.filter((filename) => /^\d{13,}-/.test(filename) && fileExtensions.some((ext) => filename.endsWith(ext)))
.map((filename) => {
const [time] = filename.split('-')
const timestamp = Number.parseInt(time ?? '')
Expand Down

0 comments on commit 042ac8c

Please sign in to comment.