I am trying to define Record for migration functions, that use as key the direction of the migration: v${number}-v${number},
Since those are all UP migrations, they should be validated as v${first-number}-v${first-number + 1} and first-number + 1 should not be more than something I defined if possible.
Does this can be done with template literals or do I have to do it at run time?
This should do. You can also use a more general implementation of
Nextusing tuples but it can get a little slowplayground