refactor: adjust option migrate and fix some issue#22
Merged
Conversation
- Dry-run no longer creates schema_migrations table as a side effect; queryCurrentVersion/queryAppliedVersions query directly with graceful fallback when the table does not exist - allowMissing=true now respected in dry-run: out-of-order pending migrations are included via appliedVersions set instead of max-version comparison - gooseMigrations nil-guards upFnContext/downFnContext to prevent panic when either migration func is nil - NumericComponent parse error is no longer silently ignored; returns descriptive error on unparseable filename - runtime.Caller ok value checked in both AddMigrationContext variants - DryRunStart prints "applying all pending" instead of math.MaxInt64 - DryRunDownStart prints "Rolling back 1 migration" for version -1 - RegularContext.Query dead defer and premature rows.Err() pre-check removed - GetCapturedSQL returns a defensive copy to prevent internal slice mutation - pendingQueries initialized with make() for consistency with capturedSQL - processDryRunMigrations unified SQL counting via GetPendingQueries
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22 +/- ##
==========================================
- Coverage 86.96% 86.53% -0.43%
==========================================
Files 32 31 -1
Lines 3267 3320 +53
==========================================
+ Hits 2841 2873 +32
- Misses 295 322 +27
+ Partials 131 125 -6 ☔ View full report in Codecov by Sentry. |
908f767 to
26f944d
Compare
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.
No description provided.