|
a.className.substring(a.className.length - 13) |
@ispirals
The no. 13 is hardcoded to the assumption - the timestamp would be only 13 chars long.
If we pass the migrationNameTimestampFormat: "yyyyMMddHHmm"
Then the timestamp length generated is only 12 chars - the generated className is "US8338476_CDF_New_Section_202507100901" with only 12 chars timestamp
Probably
const timestampLength = timestamp(migrationNameTimestampFormat).length;
const aTimestamp = Number(
a.className.substring(a.className.length - timestampLength)
);
const bTimestamp = Number(
b.className.substring(b.className.length - timestampLength)
);
PR : https://github.com/mycodeself/mongo-migrate-ts/pull/133/files
mongo-migrate-ts/lib/commands/up.ts
Line 53 in 40c16ed
@ispirals
The no. 13 is hardcoded to the assumption - the timestamp would be only 13 chars long.
If we pass the migrationNameTimestampFormat: "yyyyMMddHHmm"
Then the timestamp length generated is only 12 chars - the generated className is "US8338476_CDF_New_Section_202507100901" with only 12 chars timestamp
Probably
const timestampLength = timestamp(migrationNameTimestampFormat).length;
const aTimestamp = Number(
a.className.substring(a.className.length - timestampLength)
);
const bTimestamp = Number(
b.className.substring(b.className.length - timestampLength)
);
PR : https://github.com/mycodeself/mongo-migrate-ts/pull/133/files