-
Notifications
You must be signed in to change notification settings - Fork 1
/
architecture.txt
52 lines (45 loc) · 1.16 KB
/
architecture.txt
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
49
50
51
52
DB:
users:
id PK NOT NULL AUTOINCREMENT,
username VARCHAR(30) NOT NULL UNIQUE,
password VARCHAR(30) NOT NULL UNIQUE,
clients:
client_id PK NOT NULL,
FOREIGN KEY (client_id) REFERENCES users (id) ON DELETE CASCADE
admins:
admin_id PK NOT NULL,
FOREIGN KEY (admin_id) REFERENCES users (id) ON DELETE CASCADE
movies:
id PK NOT NULL AUTOINCREMENT,
name VARCHAR(50) NOT NULL,
rating REAL NOT NULL,
CONSTRAINT rating CHECK (rating >=1.0 AND rating <=10.0)'
projections:
id PK NOT NULL AUTOINCREMENT,
movie_id INTEGER NOT NULL,
FOREIGN KEY (movie_id) REFERENCES movies(id) ON DELETE CASCADE
reservations:
id PK NOT NULL AUTOINCREMENT,
user_id INTEGER NOT NULL,
projection_id INTEGER NOT NULL,
row INTEGER NOT NULL,
cow INTEGER NOT NULL,
FOREIGN KEY (user_id) REFERENCES client (client_id) ON DELETE CASCADE
FOREIGN KEY (projection_id) REFERENCES projections(id) ON DELETE CASCADE
admin:
-add movie
-add projection
-delete movie
-delete projection
-add admin
-delete admin
-delete clients
-exit
-help
client:
- show movie
- show movie projection <movie_id> [<date>]
- make reservation
- cancel reservation <name>
- exit
- help