Repository navigation
Conversation
apso migrate wrote the migration, then tested it. On a failure the file stayed, so the next run read it as the deployed schema and reported nothing to migrate. Now a failed test deletes the migration and its .plan.json and restores .apso/migration-plan.json, which keeps the answers and the baseline. A rerun (with a changed answer, or --accept-loss when the loss is intended) picks up where the failed one stopped. Checked end to end on a scaffolded TS project: dropping Contact.fullName with seeded rows fails on data loss and leaves no migration; rerunning with --accept-loss contact.fullName writes and verifies it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
apso migratewrites the migration, then tests it on a PGlite copy of the deployed schema. When the test failed, the migration stayed on disk, so the next run read it as deployed and printed "Nothing to migrate". The error message told people to rerun, which then did nothing.Now a failed test deletes the migration and its
.plan.jsonand restores.apso/migration-plan.jsonwith the answers and baseline. Rerunning, either with a changed answer or with--accept-losswhen the loss is intended, picks up where it stopped.Checked end to end on a scaffolded TypeScript project with the split-field fixture:
apso migrate --baseline deployed.apsorc --answer field:Contact.fullName=drop --seed seed.sqlfails on data loss (contact.fullName: 4 of 4 values), exits 1, and leaves no migration file. The plan keeps both answers andbefore.apso migrate --seed seed.sql --accept-loss contact.fullNamewrites the migration and verifies it, exit 0.tsc clean, lint 0 errors, 518 tests pass.