rerun SKIP does not work when using to and sequelize storage
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- aws, typescript
Research direction
No files or tests are named. Start by reproducing the migration flow with SequelizeStorage, SQL migrations, to, and rerun: 'SKIP'; then trace how pending migrations are selected for the to path. Done means previously executed migrations are skipped rather than causing a "Couldn't find migration" error.
Written by the indexing model from the issue text.
Description
Version: 3.2.1
Storage: SequelizeStorage
Dev setup: Typescript
Reproduction:
- Run migrations using .sql files first
- Rerun using 'to' to run to a specific migration, with rerun set to SKIP
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'.
- Dominant language
- TypeScript
- Stars
- 2.2k
- Forks
- 163
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequelize/umzug
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Security Vulnerability: ajv (JSON Schema Validator)Possibly taken @claabs claimed this 246 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 40/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
ranxianglei/billion-context#5893 ·
Maintainers usually reply within 1 day
-
stringify escapes leading digits in pseudo-class arguments (:nth-child(1) becomes :nth-child(\31 ))Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day
-
enhancement security severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Battle-Cattle/BCUK-Bot-4#959 ·
Maintainers usually reply within 1 day
-
[Bug]: Claude account rows no longer show the email (since #8055), so "Account 1, 2, 3" cannot be told apartPossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug gui
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lidge-jun/opencodex#8286 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day