feat: Add bd repair command for orphaned foreign key refs (hq-2cchm)
When the database has orphaned dependencies or labels, the migration invariant check fails and prevents the database from opening. This creates a chicken-and-egg problem where bd doctor --fix cannot run. The new bd repair command: - Opens SQLite directly, bypassing invariant checks - Deletes orphaned dependencies (issue_id or depends_on_id not in issues) - Deletes orphaned labels (issue_id not in issues) - Runs WAL checkpoint to persist changes - Supports --dry-run to preview what would be cleaned 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -281,6 +281,7 @@ var rootCmd = &cobra.Command{
|
||||
"powershell",
|
||||
"prime",
|
||||
"quickstart",
|
||||
"repair",
|
||||
"setup",
|
||||
"version",
|
||||
"zsh",
|
||||
|
||||
Reference in New Issue
Block a user