-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbSetup.sql
37 lines (32 loc) · 968 Bytes
/
dbSetup.sql
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
32
33
34
35
36
37
-- .read dbSetup.sql
-- .open subjects.db
PRAGMA foreign_keys = ON;
-- subject
CREATE TABLE IF NOT EXISTS subjects (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL UNIQUE,
zoomUrl TEXT,
zoomPasscode TEXT
);
-- alternate names for a subject
CREATE TABLE IF NOT EXISTS aliases (
subject_id INTEGER NOT NULL,
alias TEXT NOT NULL UNIQUE,
FOREIGN KEY (subject_id) REFERENCES subjects(id)
);
-- urls to be opened when a subject is selected
CREATE TABLE IF NOT EXISTS urls (
subject_id INTEGER NOT NULL,
url TEXT NOT NULL UNIQUE,
FOREIGN KEY (subject_id) REFERENCES subjects(id)
);
-- -- information on zoom meetings
-- CREATE TABLE IF NOT EXISTS zoom (
-- id INTEGER PRIMARY KEY AUTOINCREMENT,
-- subject_id INTEGER NOT NULL,
-- -- precedence INTEGER NOT NULL, -- autoincrement? uncomment unless only supporting 1 zoom/subject
-- url TEXT NOT NULL,
-- passcode TEXT NOT NULL,
-- FOREIGN KEY (subject_id) REFERENCES subjects(id)
-- );
-- .quit