-
-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rerun SKIP does not work when using to and sequelize storage #588
Comments
So I understand better, are you saying that the the |
@mmkal This might be an error on my part, seems typescript resolved the types a bit strangely for me in my editor leading me to believe that |
Version: 3.2.1
Storage: SequelizeStorage
Dev setup: Typescript
Reproduction:
Expected:
In this case it is expected that it would skip any migrations that have already been run.
Actual:
Migration fails with 'Couldn't find migration' Error because pending migrations will not include migrations found in SequelizeStorage making the rerun flag redundant and the behavior a bit broken.
It appears that the rerun flag is only applicable when 'migrations' are passed to up, not when 'to' is used.
We use AWS CustomResources to control migrations in our environment and that means we create the CustomResource with an up and down migration set and this causes them to fail if we for some reason need to rerun the underlying AWS Lambda with the same parameters. To solve this we need to be able to skip any migration that has already been run, instead of having it throw this error. Not sure about the approach here as rerun and to in this context seems to more mean that it would then only be that migration that would be skipped if it was already ran.
I guess a workaround would be to simple load the glob we use, sort it, and then slice at the 'to' index and run those migrations with
rerun: 'SKIP'
.The text was updated successfully, but these errors were encountered: