Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Commit b69d3dd

Browse files
authored
Update runmigration.js
fix options -rev and sort
1 parent fc3080a commit b69d3dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/runmigration.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ let migrationFiles = fs.readdirSync(migrationsDir)
6565
})
6666
// sort by revision
6767
.sort( (a, b) => {
68-
let revA = parseInt( path.basename(a).split('-',2)[0]),
69-
revB = parseInt( path.basename(b).split('-',2)[0]);
68+
let revA = parseInt( path.basename(a).split('-',2)[1]),
69+
revB = parseInt( path.basename(b).split('-',2)[1]);
7070
if (revA < revB) return -1;
7171
if (revA > revB) return 1;
7272
return 0;
7373
})
7474
// remove all migrations before fromRevision
7575
.filter((file) => {
76-
let rev = parseInt( path.basename(file).split('-',2)[0]);
76+
let rev = parseInt( path.basename(file).split('-',2)[1]);
7777
return (rev >= fromRevision);
7878
});
7979

0 commit comments

Comments
 (0)