blob: 5aae339dc41ca0183ab3ef5aac180a78d74f1a1a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
-- Directive memory system: persistent key-value storage for directives.
-- Allows directives to store and retrieve context across sessions.
CREATE TABLE directive_memories (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
directive_id UUID NOT NULL REFERENCES directives(id) ON DELETE CASCADE,
key VARCHAR(255) NOT NULL,
value TEXT NOT NULL,
category VARCHAR(100),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (directive_id, key)
);
CREATE INDEX idx_directive_memories_directive_id ON directive_memories(directive_id);
CREATE INDEX idx_directive_memories_category ON directive_memories(directive_id, category);
|