-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
71 lines (65 loc) · 1.92 KB
/
schema.sql
File metadata and controls
71 lines (65 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
-- Memory entries for collaboration surfaces
CREATE TABLE IF NOT EXISTS memory_entries (
id TEXT PRIMARY KEY,
content TEXT NOT NULL,
workspace TEXT,
layer TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Codex entries for semantic documentation
CREATE TABLE IF NOT EXISTS codex_entries (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
content TEXT NOT NULL,
layer TEXT,
category TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Products catalog
CREATE TABLE IF NOT EXISTS products (
id TEXT PRIMARY KEY,
name TEXT NOT NULL,
title TEXT,
domain TEXT,
category TEXT,
description TEXT,
metadata TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Collaboration logs
CREATE TABLE IF NOT EXISTS collab_logs (
id TEXT PRIMARY KEY,
workspace TEXT NOT NULL,
event_type TEXT,
collaborators TEXT,
content TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Todos/tasks
CREATE TABLE IF NOT EXISTS todos (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
description TEXT,
status TEXT DEFAULT 'pending',
workspace TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Analytics events
CREATE TABLE IF NOT EXISTS analytics_events (
id TEXT PRIMARY KEY,
workspace TEXT NOT NULL,
event_type TEXT,
user_id TEXT,
metadata TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Create indexes
CREATE INDEX IF NOT EXISTS idx_memory_workspace ON memory_entries(workspace);
CREATE INDEX IF NOT EXISTS idx_memory_layer ON memory_entries(layer);
CREATE INDEX IF NOT EXISTS idx_codex_layer ON codex_entries(layer);
CREATE INDEX IF NOT EXISTS idx_todos_workspace ON todos(workspace);
CREATE INDEX IF NOT EXISTS idx_todos_status ON todos(status);
CREATE INDEX IF NOT EXISTS idx_analytics_workspace ON analytics_events(workspace);