-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
48 lines (43 loc) · 1.01 KB
/
init.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
38
39
40
41
42
43
44
45
46
47
48
CREATE TABLE Location (
location_id INTEGER PRIMARY KEY,
description TEXT,
address VARCHAR(255),
url VARCHAR(255)
);
CREATE TABLE Session (
session_id INTEGER PRIMARY KEY,
location_id INTEGER,
session_date DATE,
start_time TIME,
end_time TIME,
description TEXT,
FOREIGN KEY (location_id) REFERENCES Location(location_id)
);
CREATE TABLE SetToSession (
session_id INTEGER,
set_id INTEGER,
set_index INTEGER,
FOREIGN KEY (session_id) REFERENCES Session(session_id),
FOREIGN KEY (set_id) REFERENCES SetTable(set_id)
);
CREATE TABLE SetTable (
set_id INTEGER PRIMARY KEY,
description TEXT
);
CREATE TABLE TuneToSet (
tune_id INTEGER,
set_id INTEGER,
tune_index INTEGER,
FOREIGN KEY (tune_id) REFERENCES Tune(tune_id),
FOREIGN KEY (set_id) REFERENCES SetTable(set_id)
);
CREATE TABLE Tune (
tune_id INTEGER PRIMARY KEY,
the_session_tune_id INTEGER,
name VARCHAR(255),
abc TEXT,
tune_type VARCHAR(255),
tune_meter VARCHAR(255),
tune_mode VARCHAR(255),
tune_url VARCHAR(255)
);