Skip to content

Use string for MigrationLog Duration instead of pgtype.Interval - #34

Merged
BolajiOlajide merged 4 commits into
mainfrom
fix/migration-log-duration-type
Mar 4, 2026
Merged

BolajiOlajide merged 4 commits into
mainfrom
fix/migration-log-duration-type

Conversation

@BolajiOlajide

@BolajiOlajide BolajiOlajide commented Mar 4, 2026 •

Copy link
Copy Markdown
Owner

Closes #21

Replace pgtype.Interval with string for the Duration field in MigrationLog to fix compatibility with non-pgx database drivers (e.g. lib/pq) that return []byte for interval columns.

Changes

  • internal/types/migration_log.go: Changed Duration field from pgtype.Interval to string, removing the pgx dependency from the types package.
  • internal/runner/runner_test.go: Added TestScanMigrationLog to verify scanning works correctly with non-pgx drivers that return []byte for interval columns.

Replace pgtype.Interval with string for the Duration field in
MigrationLog to fix compatibility with non-pgx database drivers
(e.g. lib/pq) that return []byte for interval columns.

Adds TestScanMigrationLog to verify scanning works correctly with
non-pgx drivers.
@BolajiOlajide
BolajiOlajide force-pushed the fix/migration-log-duration-type branch from dd018a3 to d23492b Compare March 4, 2026 21:15
@BolajiOlajide BolajiOlajide self-assigned this Mar 4, 2026
@BolajiOlajide
BolajiOlajide merged commit ae2b4d0 into main Mar 4, 2026
2 checks passed
@BolajiOlajide
BolajiOlajide deleted the fix/migration-log-duration-type branch March 4, 2026 23:19
BolajiOlajide added a commit that referenced this pull request Mar 8, 2026
Updates CHANGELOG.md to include all releases since v0.0.11 through
v0.1.2 and adds an Unreleased section covering recent work.

## Changes
- Added entries for v0.0.11, v0.1.0, v0.1.1, v0.1.2
- Added detailed Unreleased section covering SQLite support (#27),
database connection hardening (#29), MigrationLog duration fix (#34),
and related bug fixes (#35-#39)
- Fixed comparison links at the bottom to reference correct tags
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.

Inability to scan duration when applying migrations

1 participant

⌂ 换网址