gitgreen 1.1.1 → 1.1.2

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.
@@ -30,7 +30,12 @@ const loadMigrations = (scope, driver) => {
30
30
  .filter(file => file.endsWith('.sql') && file.startsWith(prefix))
31
31
  .sort();
32
32
  return files.map(file => {
33
- const id = Number(file.split('_')[0]);
33
+ const segments = file.replace('.sql', '').split('_');
34
+ const numericSegment = segments[2];
35
+ const id = Number(numericSegment);
36
+ if (!Number.isFinite(id)) {
37
+ throw new Error(`Invalid migration filename: ${file}`);
38
+ }
34
39
  return {
35
40
  id,
36
41
  name: file,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitgreen",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "GitGreen CLI for carbon reporting in GitLab pipelines (GCP/AWS)",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",