-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.ts
More file actions
31 lines (27 loc) · 707 Bytes
/
setup.ts
File metadata and controls
31 lines (27 loc) · 707 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
25
26
27
28
29
30
31
import database from "@/database";
database.exec(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
email TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
)
`);
database.exec(`
CREATE TABLE IF NOT EXISTS schedules (
id TEXT PRIMARY KEY,
owner TEXT NOT NULL,
name TEXT NOT NULL,
public BOOLEAN NOT NULL
)
`);
database.exec(`
CREATE TABLE IF NOT EXISTS tasks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
schedule TEXT NOT NULL,
name TEXT,
time_start TIMESTAMP,
time_end TIMESTAMP
)
`);
console.log("Created database successfully!")