aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/1.sql
diff options
context:
space:
mode:
authorLibravatar cel 🌸 <cel@bunny.garden>2025-06-05 03:50:36 +0100
committerLibravatar cel 🌸 <cel@bunny.garden>2025-06-05 03:51:28 +0100
commite313c40d246ac7545a1907621841090664bf61ae (patch)
tree1eb8d9435da628b6bae242c5cfb89f939d47fc21 /migrations/1.sql
parent811ff64dd08c8835d19c57fd959e42a28d800a53 (diff)
downloadfj-main.tar.gz
fj-main.tar.bz2
fj-main.zip
feat: database functionsHEADmain
Diffstat (limited to 'migrations/1.sql')
-rw-r--r--migrations/1.sql36
1 files changed, 36 insertions, 0 deletions
diff --git a/migrations/1.sql b/migrations/1.sql
new file mode 100644
index 0000000..e540cac
--- /dev/null
+++ b/migrations/1.sql
@@ -0,0 +1,36 @@
+PRAGMA foreign_keys = on;
+
+create table tasks (
+ id blob primary key,
+ name text unique not null,
+ -- TODO: multiple crons?
+ cron text,
+ archived integer not null default 0,
+ description text
+);
+
+create table categories (
+ id blob primary key,
+ name text unique not null
+);
+
+create table tasks_categories (
+ task_id blob not null,
+ category_id blob not null,
+ foreign key(task_id) references tasks(id) on delete cascade,
+ foreign key(category_id) references categories(id) on delete cascade
+);
+
+create table log (
+ id blob primary key,
+ task_id blob not null,
+ timestamp text not null,
+ foreign key(task_id) references tasks(id) on delete cascade
+);
+
+create table reminders (
+ id blob primary key,
+ task_id blob not null,
+ time_delta text not null,
+ foreign key(task_id) references tasks(id) on delete cascade
+);