Revert bd-191: Remove merged_into schema field
Use simpler approach for bd-190 merge feature: - Close merged issues with reason 'Merged into bd-X' - No schema changes or migrations needed - Parseable close reason is cleaner than separate field Also updated merge epic child issues with simplified design.
This commit is contained in:
9189
.beads/issues.jsonl
9189
.beads/issues.jsonl
File diff suppressed because one or more lines are too long
@@ -464,38 +464,38 @@ func (s *SQLiteStorage) GetDependencyTree(ctx context.Context, issueID string, m
|
|||||||
rows, err := s.db.QueryContext(ctx, `
|
rows, err := s.db.QueryContext(ctx, `
|
||||||
WITH RECURSIVE tree AS (
|
WITH RECURSIVE tree AS (
|
||||||
SELECT
|
SELECT
|
||||||
i.id, i.title, i.status, i.priority, i.description, i.design,
|
i.id, i.title, i.status, i.priority, i.description, i.design,
|
||||||
i.acceptance_criteria, i.notes, i.issue_type, i.assignee,
|
i.acceptance_criteria, i.notes, i.issue_type, i.assignee,
|
||||||
i.estimated_minutes, i.created_at, i.updated_at, i.closed_at,
|
i.estimated_minutes, i.created_at, i.updated_at, i.closed_at,
|
||||||
i.external_ref,
|
i.external_ref,
|
||||||
0 as depth,
|
0 as depth,
|
||||||
i.id as path,
|
i.id as path,
|
||||||
i.id as parent_id
|
i.id as parent_id
|
||||||
FROM issues i
|
FROM issues i
|
||||||
WHERE i.id = ?
|
WHERE i.id = ?
|
||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
i.id, i.title, i.status, i.priority, i.description, i.design,
|
i.id, i.title, i.status, i.priority, i.description, i.design,
|
||||||
i.acceptance_criteria, i.notes, i.issue_type, i.assignee,
|
i.acceptance_criteria, i.notes, i.issue_type, i.assignee,
|
||||||
i.estimated_minutes, i.created_at, i.updated_at, i.closed_at,
|
i.estimated_minutes, i.created_at, i.updated_at, i.closed_at,
|
||||||
i.external_ref,
|
i.external_ref,
|
||||||
t.depth + 1,
|
t.depth + 1,
|
||||||
t.path || '→' || i.id,
|
t.path || '→' || i.id,
|
||||||
t.id
|
t.id
|
||||||
FROM issues i
|
FROM issues i
|
||||||
JOIN dependencies d ON i.id = d.depends_on_id
|
JOIN dependencies d ON i.id = d.depends_on_id
|
||||||
JOIN tree t ON d.issue_id = t.id
|
JOIN tree t ON d.issue_id = t.id
|
||||||
WHERE t.depth < ?
|
WHERE t.depth < ?
|
||||||
AND t.path NOT LIKE '%' || i.id || '%'
|
AND t.path NOT LIKE '%' || i.id || '%'
|
||||||
)
|
)
|
||||||
SELECT id, title, status, priority, description, design,
|
SELECT id, title, status, priority, description, design,
|
||||||
acceptance_criteria, notes, issue_type, assignee,
|
acceptance_criteria, notes, issue_type, assignee,
|
||||||
estimated_minutes, created_at, updated_at, closed_at,
|
estimated_minutes, created_at, updated_at, closed_at,
|
||||||
external_ref, depth, parent_id
|
external_ref, depth, parent_id
|
||||||
FROM tree
|
FROM tree
|
||||||
ORDER BY depth, priority, id
|
ORDER BY depth, priority, id
|
||||||
`, issueID, maxDepth)
|
`, issueID, maxDepth)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to get dependency tree: %w", err)
|
return nil, fmt.Errorf("failed to get dependency tree: %w", err)
|
||||||
|
|||||||
@@ -436,6 +436,8 @@ func migrateCompactedAtCommitColumn(db *sql.DB) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// getNextIDForPrefix atomically generates the next ID for a given prefix
|
// getNextIDForPrefix atomically generates the next ID for a given prefix
|
||||||
// Uses the issue_counters table for atomic, cross-process ID generation
|
// Uses the issue_counters table for atomic, cross-process ID generation
|
||||||
func (s *SQLiteStorage) getNextIDForPrefix(ctx context.Context, prefix string) (int, error) {
|
func (s *SQLiteStorage) getNextIDForPrefix(ctx context.Context, prefix string) (int, error) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ type Issue struct {
|
|||||||
CompactedAt *time.Time `json:"compacted_at,omitempty"`
|
CompactedAt *time.Time `json:"compacted_at,omitempty"`
|
||||||
CompactedAtCommit *string `json:"compacted_at_commit,omitempty"` // Git commit hash when compacted
|
CompactedAtCommit *string `json:"compacted_at_commit,omitempty"` // Git commit hash when compacted
|
||||||
OriginalSize int `json:"original_size,omitempty"`
|
OriginalSize int `json:"original_size,omitempty"`
|
||||||
Labels []string `json:"labels,omitempty"` // Populated only for export/import
|
Labels []string `json:"labels,omitempty"` // Populated only for export/import
|
||||||
Dependencies []*Dependency `json:"dependencies,omitempty"` // Populated only for export/import
|
Dependencies []*Dependency `json:"dependencies,omitempty"` // Populated only for export/import
|
||||||
Comments []*Comment `json:"comments,omitempty"` // Populated only for export/import
|
Comments []*Comment `json:"comments,omitempty"` // Populated only for export/import
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user