beads/internal/storage/sqlite/migrations
Steve Yegge 6d84701a5f fix: migration 022 fails with SQL syntax error on v0.30.3 upgrade
db.Exec was being passed %s format specifiers directly in the SQL
string, but db.Exec does not do printf-style formatting - it uses the
variadic args as SQL parameter bindings. This caused the literal %s
to be sent to SQLite, which failed with near percent: syntax error.

Fixed by using fmt.Sprintf to interpolate the column expressions into
the SQL string before passing to db.Exec.

Added regression test that creates an old-schema database with edge
columns (replies_to, relates_to, duplicate_of, superseded_by) and
verifies migration 022 completes successfully.

Fixes #809

Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 16:45:01 -08:00
..
001_dirty_issues_table.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
002_external_ref_column.go Fix CI regressions and stabilize tests 2025-11-17 10:06:35 -07:00
003_composite_indexes.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
004_closed_at_constraint.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
005_compaction_columns.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
006_snapshots_table.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
007_compaction_config.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
008_compacted_at_commit_column.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
009_export_hashes_table.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
010_content_hash_column.go fix: prevent parallel execution migration race conditions (GH#720) 2025-12-23 00:55:05 -08:00
011_external_ref_unique.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
012_source_repo_column.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
013_repo_mtimes_table.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
014_child_counters_table.go Extract SQLite migrations into separate files (bd-fb95094c.7) 2025-11-06 20:06:45 -08:00
015_blocked_issues_cache.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
016_orphan_detection.go fix: Exclude closed issues from orphan detection warnings 2025-12-17 23:32:37 -08:00
017_close_reason_column.go fix(db): add close_reason column to issues table (bd-uyu) 2025-12-01 21:56:41 -08:00
018_tombstone_columns.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
019_messaging_fields.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
020_edge_consolidation.go Phase 1: Edge schema consolidation infrastructure (Decision 004) 2025-12-18 01:17:57 -08:00
021_migrate_edge_fields.go refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
022_drop_edge_columns.go fix: migration 022 fails with SQL syntax error on v0.30.3 upgrade 2025-12-30 16:45:01 -08:00
022_drop_edge_columns_test.go fix: migration 022 fails with SQL syntax error on v0.30.3 upgrade 2025-12-30 16:45:01 -08:00
023_pinned_column.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
024_is_template_column.go refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
025_remove_depends_on_fk.go fix: prevent parallel execution migration race conditions (GH#720) 2025-12-23 00:55:05 -08:00
026_additional_indexes.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
027_gate_columns.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
028_tombstone_closed_at.go fix: resolve golangci-lint errors (errcheck, gosec, unparam) 2025-12-28 20:50:54 -08:00
029_created_by_column.go refactor: remove unused bd pin/unpin/hook commands (bd-x0zl) 2025-12-27 16:02:15 -08:00
030_agent_fields.go chore: remove issue ID references from comments and changelogs 2025-12-28 10:05:16 -08:00
031_mol_type_column.go feat: Add mol_type schema field for molecule type classification (bd-oxgi) 2025-12-28 19:52:51 -08:00
032_hooked_status_migration.go feat: Add 'hooked' status for GUPP work assignment (bd-s00m) 2025-12-28 22:37:04 -08:00
033_event_fields.go feat: add type: event for operational state changes (bd-ecmd) 2025-12-30 15:54:51 -08:00