Skip to content
This repository was archived by the owner on Jun 16, 2023. It is now read-only.

Allow custom sort function when using as a libraryΒ #255

@nholik

Description

@nholik

I have been using this tool as a library to run automated migrations and one thing that would be useful would be to allow specifying a custom sorting function that would flow to the node-migrate library see here. This would be difficult to expose via the CLI, but it would be a non-breaking change if it is left unspecified as it is now.

What happens right now is since the default sort is a lexical sort on file name, when using, what I think are, more readable names like 1-migration.js, 2-migration.js, etc. once you hit 10-, the run order is (un)expected if you cross a digit boundary during a run.

I'd be happy to submit a PR showing my idea - it's pretty simple and would not change the tool as it is now and only take effect in more advanced use cases such as my own.

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