5 CREATE TABLE process_descriptions (
6 process_id INTEGER NOT NULL,
7 timestamp TEXT NOT NULL,
8 description TEXT NOT NULL,
9 PRIMARY KEY (process_id, timestamp),
10 FOREIGN KEY (process_id) REFERENCES processes(id)
12 CREATE TABLE process_efforts (
13 process_id INTEGER NOT NULL,
14 timestamp TEXT NOT NULL,
16 PRIMARY KEY (process_id, timestamp),
17 FOREIGN KEY (process_id) REFERENCES processes(id)
19 CREATE TABLE process_steps (
20 step_id INTEGER PRIMARY KEY,
21 owner_id INTEGER NOT NULL,
22 step_process_id INTEGER NOT NULL,
23 parent_step_id INTEGER,
24 FOREIGN KEY (owner_id) REFERENCES processes(id),
25 FOREIGN KEY (step_process_id) REFERENCES processes(id),
26 FOREIGN KEY (parent_step_id) REFERENCES process_steps(step_id)
28 CREATE TABLE process_titles (
29 process_id INTEGER NOT NULL,
30 timestamp TEXT NOT NULL,
32 PRIMARY KEY (process_id, timestamp),
33 FOREIGN KEY (process_id) REFERENCES processes(id)
35 CREATE TABLE processes (
36 id INTEGER PRIMARY KEY
39 id INTEGER PRIMARY KEY,
40 process_id INTEGER NOT NULL,
41 is_done BOOLEAN NOT NULL,
43 FOREIGN KEY (process_id) REFERENCES processes(id),
44 FOREIGN KEY (day) REFERENCES days(date)