Skip to content

fix: bump schema version so no_history migration runs on existing DBs#2651

Open
timvisher-dd wants to merge 4 commits intosteveyegge:mainfrom
timvisher-dd:timvisher/fix/schema-version-and-hook
Open

fix: bump schema version so no_history migration runs on existing DBs#2651
timvisher-dd wants to merge 4 commits intosteveyegge:mainfrom
timvisher-dd:timvisher/fix/schema-version-and-hook

Conversation

@timvisher-dd
Copy link
Contributor

@timvisher-dd timvisher-dd commented Mar 16, 2026

  • Bump currentSchemaVersion from 7 to 8 so that initSchemaOnDB re-runs migrations on databases already at version 7. PR feat: add --no-history flag to separate Dolt commit skipping from GC eligibility #2622 added migration 011 (add_no_history_column) but did not bump the schema version, so existing databases take the fast path and skip RunMigrations, causing "column no_history could not be found" on every bd command.
  • Replace global golangci-lint binary with go run in the pre-commit hook, pinned to v2.10.1. This ensures the linter is always compiled with the project's Go toolchain, eliminating panics when the global binary was built with an older Go than the runtime (e.g., golangci-lint built with 1.25 vs runtime 1.26).
  • Fix versionChanges ordering in info.go — the 0.61.0 entry was appended at the end instead of prepended, breaking TestGetVersionsSinceOrder. Also merges two duplicate 0.60.0 entries into one.
  • Add no_history column migration for embedded Dolt — the embedded Dolt schema migrations were missing the no_history column, causing all embedded Dolt CI tests to fail.

Test plan

  • Run bd ready / bd ls against a .beads database created before the no_history column existed — succeeds without errors
  • Verify schema_version in the config table is updated to 8 after first run
  • Commit a .go file change and confirm the pre-commit hook runs go run golangci-lint successfully without requiring a global install
  • TestGetVersionsSinceOrder passes
  • CI: Embedded Dolt tests pass with new migration 0023
  • CI tests pass (migrations are idempotent)

@codecov-commenter
Copy link

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4805 1 4804 548
View the top 1 failed test(s) by shortest run time
github.com/steveyegge/beads/cmd/bd::TestGetVersionsSinceOrder
Stack Traces | 0s run time
=== RUN   TestGetVersionsSinceOrder
    version_tracking_test.go:80: Versions not in chronological order: 0.61.0 (2026-03-15) should come before 0.57.0 (2026-03-01)
--- FAIL: TestGetVersionsSinceOrder (0.00s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

timvisher-dd and others added 3 commits March 16, 2026 17:31
Replace the global golangci-lint binary with `go run` pinned to v2.10.1.
This ensures golangci-lint is always compiled with the project's Go
toolchain, eliminating version-mismatch panics when the global binary
was built with an older Go (e.g., 1.25) than the runtime (e.g., 1.26).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR steveyegge#2622 added migration 011 (add_no_history_column) but did not bump
currentSchemaVersion. Databases already at version 7 take the fast path
in initSchemaOnDB and skip RunMigrations entirely, causing "column
no_history could not be found" errors on every bd command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…60.0 entries

The 0.61.0 version bump appended the entry at the end of the
versionChanges array instead of prepending it. This broke
TestGetVersionsSinceOrder which expects newest-first ordering.
Also merges the two separate 0.60.0 entries into one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@timvisher-dd timvisher-dd force-pushed the timvisher/fix/schema-version-and-hook branch from 2d7a099 to 2fc7074 Compare March 16, 2026 21:31
@timvisher-dd timvisher-dd marked this pull request as ready for review March 16, 2026 21:34
The embedded Dolt schema migrations were missing the no_history column
added by migration 011 in the regular Dolt path, causing all embedded
Dolt CI tests to fail with "Unknown column 'no_history' in 'issues'".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants