mythix 2.8.2 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mythix",
3
- "version": "2.8.2",
3
+ "version": "2.8.3",
4
4
  "description": "Mythix is a NodeJS web-app framework",
5
5
  "main": "src/index",
6
6
  "scripts": {
@@ -59,16 +59,17 @@ module.exports = defineCommand('migrate', ({ Parent }) => {
59
59
  let revision = ('' + _revision);
60
60
 
61
61
  let index = migrationFiles.findIndex((fullFileName) => {
62
- let fileName = Path.basename(fullFileName);
62
+ let fileName = Path.basename(fullFileName);
63
+ let migrationFileTS = fileName.substring(0, TIMESTAMP_LENGTH);
63
64
 
64
- if (fileName.substring(0, TIMESTAMP_LENGTH) === revision)
65
+ if (BigInt(revision) >= BigInt(migrationFileTS))
65
66
  return true;
66
67
 
67
68
  return false;
68
69
  });
69
70
 
70
71
  if (index < 0)
71
- throw new Error(`Error, migration revision ${revision} not found. Aborting...`);
72
+ return migrationFiles.slice();
72
73
 
73
74
  return migrationFiles.slice((isRollback) ? index : index + 1);
74
75
  }