Skip to content

refactor: adjust option migrate and fix some issue#22

Merged
akfaiz merged 7 commits into
mainfrom
feat/adjust-apply-option
May 20, 2026
Merged

refactor: adjust option migrate and fix some issue#22
akfaiz merged 7 commits into
mainfrom
feat/adjust-apply-option

Conversation

@akfaiz

@akfaiz akfaiz commented May 20, 2026

Copy link
Copy Markdown
Owner

No description provided.

akfaiz added 5 commits May 20, 2026 18:09
- 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

codecov Bot commented May 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.07006% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.53%. Comparing base (6e251bd) to head (26f944d).

Files with missing lines Patch % Lines
migrate.go 68.57% 11 Missing ⚠️
up.go 78.78% 4 Missing and 3 partials ⚠️
internal/logger/logger.go 33.33% 4 Missing and 2 partials ⚠️
register.go 68.42% 6 Missing ⚠️
internal/dialect/dialect.go 72.72% 3 Missing ⚠️
options.go 82.35% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@akfaiz akfaiz force-pushed the feat/adjust-apply-option branch from 908f767 to 26f944d Compare May 20, 2026 14:17
@akfaiz akfaiz merged commit 6c48b9c into main May 20, 2026
4 of 6 checks passed
@akfaiz akfaiz deleted the feat/adjust-apply-option branch May 20, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant