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

Allow custom sort function when using as a library #255

Open
nholik opened this issue Mar 9, 2022 · 0 comments
Open

Allow custom sort function when using as a library #255

nholik opened this issue Mar 9, 2022 · 0 comments

Comments

@nholik
Copy link

nholik commented Mar 9, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant