home
·
contact
·
privacy
projects
/
misc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix.
[misc]
/
new_todo
/
init.sql
diff --git
a/new_todo/init.sql
b/new_todo/init.sql
index 49b52d80d34f7ab6139e102d6df243fe3d8c24cc..a911fb02c8f21cb5383e42886fad3e71322674a5 100644
(file)
--- a/
new_todo/init.sql
+++ b/
new_todo/init.sql
@@
-3,23
+3,30
@@
CREATE TABLE days (
comment TEXT NOT NULL
);
CREATE TABLE templates (
comment TEXT NOT NULL
);
CREATE TABLE templates (
- id INTEGER PRIMARY KEY
+ id INTEGER PRIMARY KEY,
+ forked_from INTEGER,
+ forked_at TEXT,
+ FOREIGN KEY (forked_from) REFERENCES templates(id)
);
CREATE TABLE versioned_default_efforts (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
default_effort REAL NOT NULL,
);
CREATE TABLE versioned_default_efforts (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
default_effort REAL NOT NULL,
- PRIMARY KEY (template, datetime)
+ PRIMARY KEY (template, datetime),
+ FOREIGN KEY (template) REFERENCES templates(id)
);
CREATE TABLE versioned_descriptions (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
description TEXT NOT NULL,
);
CREATE TABLE versioned_descriptions (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
description TEXT NOT NULL,
- PRIMARY KEY (template, datetime)
+ PRIMARY KEY (template, datetime),
+ FOREIGN KEY (template) REFERENCES templates(id)
+
);
CREATE TABLE versioned_titles (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
title TEXT NOT NULL,
);
CREATE TABLE versioned_titles (
template INTEGER NOT NULL,
datetime TEXT NOT NULL,
title TEXT NOT NULL,
- PRIMARY KEY (template, datetime)
+ PRIMARY KEY (template, datetime),
+ FOREIGN KEY (template) REFERENCES templates(id)
);
);