Skip to content

Classname should consider the timestamp format #132

@ChaitanyaKadamati

Description

@ChaitanyaKadamati

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions