aboutsummaryrefslogtreecommitdiff
path: root/src/db/init.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/init.py')
-rw-r--r--src/db/init.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/db/init.py b/src/db/init.py
index 8292dfc..6b4cbea 100644
--- a/src/db/init.py
+++ b/src/db/init.py
@@ -19,7 +19,6 @@ def init(path):
" updated_at INTEGER NOT NULL,"
" name TEXT NOT NULL,"
" duration INTEGER,"
- " tag TEXT,"
" difficulty INT,"
" priority INT,"
" description TEXT"
@@ -34,6 +33,16 @@ def init(path):
" color TEXT NOT NULL"
" )")
+ cursor.execute(
+ " CREATE TABLE IF NOT EXISTS task_tags("
+ " task_id INTEGER NOT NULL,"
+ " tag_id INTEGER NOT NULL,"
+ " created_at INTEGER NOT NULL,"
+ " FOREIGN KEY (task_id) REFERENCES tasks(id),"
+ " FOREIGN KEY (tag_id) REFERENCES tags(id),"
+ " PRIMARY KEY (task_id, tag_id)"
+ " )")
+
database.commit()
return database