docs: polish structured learnings README for issue #4
Some checks failed
CI / build-and-test (push) Failing after -33m23s
CI / build-and-test (pull_request) Failing after -33m33s

This commit is contained in:
2026-04-22 00:50:18 +02:00
parent 3dfed9c986
commit 4bb3e1af58
4 changed files with 277 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
CREATE TABLE learnings (
guid UUID PRIMARY KEY DEFAULT gen_random_uuid(),
summary TEXT NOT NULL,
details TEXT,
category TEXT,
area TEXT,
status TEXT NOT NULL DEFAULT 'provisional',
priority TEXT DEFAULT 'medium',
confidence TEXT DEFAULT 'hypothesis',
action_required BOOLEAN DEFAULT false,
source_type TEXT,
source_ref TEXT,
project_id UUID REFERENCES projects(guid) ON DELETE SET NULL,
related_thought_id UUID REFERENCES thoughts(guid) ON DELETE SET NULL,
related_skill_id UUID REFERENCES skills(guid) ON DELETE SET NULL,
reviewed_by TEXT,
reviewed_at TIMESTAMP WITH TIME ZONE,
duplicate_of UUID REFERENCES learnings(guid) ON DELETE SET NULL,
supersedes UUID REFERENCES learnings(guid) ON DELETE SET NULL,
tags TEXT[],
created_at TIMESTAMP WITH TIME ZONE DEFAULT now(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT now()
);
CREATE INDEX idx_learnings_project_id ON learnings(project_id);
CREATE INDEX idx_learnings_category ON learnings(category);
CREATE INDEX idx_learnings_status ON learnings(status);
CREATE INDEX idx_learnings_tags ON learnings USING GIN(tags);
CREATE INDEX idx_learnings_search ON learnings USING GIN(to_tsvector('simple', summary || ' ' || coalesce(details, '')));