chore(db): add playbook versioning migration
Some checks failed
CD Pipeline / tests (push) Successful in 1m32s
Code Review / ai-code-review (push) Successful in 27s
run-migration / migrate (push) Failing after 13s
CD Pipeline / build-and-deploy (push) Has started running
CD Pipeline / post-deploy-checks (push) Has been cancelled
E2E Health Check / e2e-health (push) Successful in 43s
Some checks failed
CD Pipeline / tests (push) Successful in 1m32s
Code Review / ai-code-review (push) Successful in 27s
run-migration / migrate (push) Failing after 13s
CD Pipeline / build-and-deploy (push) Has started running
CD Pipeline / post-deploy-checks (push) Has been cancelled
E2E Health Check / e2e-health (push) Successful in 43s
This commit is contained in:
20
apps/api/migrations/adr104_playbook_versioning.sql
Normal file
20
apps/api/migrations/adr104_playbook_versioning.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- ADR-104 T4: Playbook versioning / lineage schema
|
||||
-- 2026-04-30 Codex: LLM-generated Playbooks must preserve lineage instead of
|
||||
-- overwriting prior operational knowledge.
|
||||
|
||||
ALTER TABLE playbooks
|
||||
ADD COLUMN IF NOT EXISTS version INTEGER NOT NULL DEFAULT 1,
|
||||
ADD COLUMN IF NOT EXISTS parent_playbook_id VARCHAR(36),
|
||||
ADD COLUMN IF NOT EXISTS supersedes_playbook_id VARCHAR(36),
|
||||
ADD COLUMN IF NOT EXISTS version_reason TEXT;
|
||||
|
||||
UPDATE playbooks
|
||||
SET parent_playbook_id = playbook_id
|
||||
WHERE parent_playbook_id IS NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS ix_playbook_lineage
|
||||
ON playbooks(parent_playbook_id, version);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS ix_playbook_supersedes
|
||||
ON playbooks(supersedes_playbook_id)
|
||||
WHERE supersedes_playbook_id IS NOT NULL;
|
||||
Reference in New Issue
Block a user