-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema.sql
More file actions
24 lines (22 loc) · 806 Bytes
/
schema.sql
File metadata and controls
24 lines (22 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT current_timestamp
);
CREATE TABLE IF NOT EXISTS projects (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
created_at TIMESTAMP DEFAULT current_timestamp,
deleted_at TIMESTAMP
);
CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY,
project_id INTEGER REFERENCES projects(id) ON DELETE CASCADE NOT NULL,
assignee_id INTEGER REFERENCES users(id) ON DELETE SET NULL,
title TEXT NOT NULL,
description TEXT,
due_date TIMESTAMP,
completed_at TIMESTAMP,
recur_policy BLOB,
created_at TIMESTAMP DEFAULT current_timestamp
);