home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactor models' .by_id().
[plomtask]
/
scripts
/
init.sql
diff --git
a/scripts/init.sql
b/scripts/init.sql
index 807e1e7a0fc06b3da97204e99a23b2342306272a..870e845c31827bd7400faea3e7ea877458493715 100644
(file)
--- a/
scripts/init.sql
+++ b/
scripts/init.sql
@@
-17,7
+17,7
@@
CREATE TABLE conditions (
is_active BOOLEAN NOT NULL
);
CREATE TABLE days (
is_active BOOLEAN NOT NULL
);
CREATE TABLE days (
-
date
TEXT PRIMARY KEY,
+
id
TEXT PRIMARY KEY,
comment TEXT NOT NULL
);
CREATE TABLE process_conditions (
comment TEXT NOT NULL
);
CREATE TABLE process_conditions (
@@
-49,7
+49,7
@@
CREATE TABLE process_fulfills (
FOREIGN KEY (condition) REFERENCES conditions(id)
);
CREATE TABLE process_steps (
FOREIGN KEY (condition) REFERENCES conditions(id)
);
CREATE TABLE process_steps (
-
step_
id INTEGER PRIMARY KEY,
+ id INTEGER PRIMARY KEY,
owner_id INTEGER NOT NULL,
step_process_id INTEGER NOT NULL,
parent_step_id INTEGER,
owner_id INTEGER NOT NULL,
step_process_id INTEGER NOT NULL,
parent_step_id INTEGER,
@@
-108,5
+108,5
@@
CREATE TABLE todos (
is_done BOOLEAN NOT NULL,
day TEXT NOT NULL,
FOREIGN KEY (process_id) REFERENCES processes(id),
is_done BOOLEAN NOT NULL,
day TEXT NOT NULL,
FOREIGN KEY (process_id) REFERENCES processes(id),
- FOREIGN KEY (day) REFERENCES days(
date
)
+ FOREIGN KEY (day) REFERENCES days(
id
)
);
);