feat(types): add tombstone support for inline soft-delete (bd-fbj)
Add tombstone types and schema migration as foundation for the tombstone epic (bd-vw8) which replaces deletions.jsonl with inline tombstones. Changes: - Add tombstone fields to Issue struct: DeletedAt, DeletedBy, DeleteReason, OriginalType - Add StatusTombstone constant and IsTombstone() helper method - Update Status.IsValid() to accept tombstone status - Create migration 018_tombstone_columns.go for new database columns - Update schema.go with tombstone columns: deleted_at, deleted_by, delete_reason, original_type - Update all issue insert/update/scan operations across: - issues.go (insertIssue, insertIssues) - queries.go (GetIssue, GetIssueByExternalRef, SearchIssues) - dependencies.go (scanIssues, scanIssuesWithDependencyType) - transaction.go (scanIssueRow, GetIssue, SearchIssues) - multirepo.go (import operations) - ready.go (GetReadyWork, GetStaleIssues) - labels.go (GetIssuesByLabel) - Add test for IsTombstone() helper - Update migration test to include tombstone columns Unblocks: bd-olt (TTL logic), bd-3b4 (delete command), bd-0ih (merge updates), bd-dve (import/export) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -464,7 +464,7 @@ func TestMigrateContentHashColumn(t *testing.T) {
|
||||
design TEXT NOT NULL DEFAULT '',
|
||||
acceptance_criteria TEXT NOT NULL DEFAULT '',
|
||||
notes TEXT NOT NULL DEFAULT '',
|
||||
status TEXT NOT NULL CHECK (status IN ('open', 'in_progress', 'blocked', 'closed')),
|
||||
status TEXT NOT NULL CHECK (status IN ('open', 'in_progress', 'blocked', 'closed', 'tombstone')),
|
||||
priority INTEGER NOT NULL,
|
||||
issue_type TEXT NOT NULL CHECK (issue_type IN ('bug', 'feature', 'task', 'epic', 'chore')),
|
||||
assignee TEXT,
|
||||
@@ -479,9 +479,13 @@ func TestMigrateContentHashColumn(t *testing.T) {
|
||||
compacted_at_commit TEXT,
|
||||
source_repo TEXT DEFAULT '.',
|
||||
close_reason TEXT DEFAULT '',
|
||||
deleted_at TEXT,
|
||||
deleted_by TEXT DEFAULT '',
|
||||
delete_reason TEXT DEFAULT '',
|
||||
original_type TEXT DEFAULT '',
|
||||
CHECK ((status = 'closed') = (closed_at IS NOT NULL))
|
||||
);
|
||||
INSERT INTO issues SELECT id, title, description, design, acceptance_criteria, notes, status, priority, issue_type, assignee, estimated_minutes, created_at, updated_at, closed_at, external_ref, compaction_level, compacted_at, original_size, compacted_at_commit, source_repo, '' FROM issues_backup;
|
||||
INSERT INTO issues SELECT id, title, description, design, acceptance_criteria, notes, status, priority, issue_type, assignee, estimated_minutes, created_at, updated_at, closed_at, external_ref, compaction_level, compacted_at, original_size, compacted_at_commit, source_repo, '', NULL, '', '', '' FROM issues_backup;
|
||||
DROP TABLE issues_backup;
|
||||
`)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user