beads/internal/storage/schema
Afik 674561360d
schema: make DROP COLUMN migrations idempotent (fixes migration 0032 loop) (#3418)
* cmd/bd: extract sanitizeDBName to its own file for CGO_ENABLED=0 lint

sanitizeDBName lived in store_factory.go which is //go:build cgo,
but init.go (no tag) calls it. The pre-commit golangci-lint runs
with CGO_ENABLED=0 and flagged it as undefined. Move the pure-Go
function to its own untagged file and drop the now-unused strings
import from store_factory.go. No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* schema: tolerate "does not have column" errors in migration runner

Broadens isConcurrentInitError to also treat "does not have column"
as a benign migration error, symmetric with the existing "duplicate
column" tolerance for ADD races. Makes DROP COLUMN migrations
idempotent across databases bootstrapped with different base schemas.

Observed failure: migration 0032 (DROP COLUMN applied_at) loops
forever on any database that lands at v31 without the column. Dolt
has no DROP COLUMN IF EXISTS, so the SQL itself can't be guarded;
handling it in the runner keeps the migration file trivial.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Add migration 0032 idempotence tests (bd-7mh.3)

* Document bd execution metadata workflow (bd-b1a)

* Revert "Document bd execution metadata workflow (bd-b1a)"

This reverts commit 0d6a96babd.

* Reapply "Document bd execution metadata workflow (bd-b1a)"

This reverts commit df90cf5404.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: matt wilkie <maphew@gmail.com>
2026-04-27 09:15:20 -07:00
..
migrations /internal/storage: remove conflicting column on schema migration table 2026-04-14 15:36:26 -07:00
helpers.go Repair ignored wisp dependency table bootstrap (bd-8e8) (#3497) 2026-04-25 17:57:31 -07:00
ignored_tables.go /internal/storage: remove conflicting column on schema migration table 2026-04-14 15:36:26 -07:00
ignored_tables_test.go Repair ignored wisp dependency table bootstrap (bd-8e8) (#3497) 2026-04-25 17:57:31 -07:00
schema.go schema: make DROP COLUMN migrations idempotent (fixes migration 0032 loop) (#3418) 2026-04-27 09:15:20 -07:00
schema_test.go schema: make DROP COLUMN migrations idempotent (fixes migration 0032 loop) (#3418) 2026-04-27 09:15:20 -07:00
views.go /internal/storage/schema: use shared schema package 2026-04-06 15:03:20 -07:00