fix(history): support a migration history with entries without file extensions (.js is assumed in such case)
This commit is contained in:
parent
114979f154
commit
73a8a42e5f
4 changed files with 67 additions and 2 deletions
|
|
@ -23,7 +23,10 @@ export const getMigrations = async (cwd: string, directory: string): Promise<Mig
|
|||
const allFilesInMigrationDirectory = await tryReadDirectory(directoryPath);
|
||||
|
||||
const migrationFiles: MigrationMetadata[] = allFilesInMigrationDirectory
|
||||
.filter((file) => file.isFile() && !file.name.startsWith('.') && !file.name.startsWith('_'))
|
||||
.filter(
|
||||
(file) =>
|
||||
file.isFile() && !file.name.startsWith('.') && !file.name.startsWith('_') && path.extname(file.name) !== '',
|
||||
)
|
||||
.sort((a, b) => a.name.localeCompare(b.name))
|
||||
.map(({ name }) => {
|
||||
const filePath = path.join(directoryPath, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue