-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_table.sql
More file actions
29 lines (26 loc) · 881 Bytes
/
Copy pathcreate_table.sql
File metadata and controls
29 lines (26 loc) · 881 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
PRAGMA foreign_keys = 1;
CREATE TABLE IF NOT EXISTS `users` (
`user` TEXT NOT NULL PRIMARY KEY,
`passwd` TEXT NOT NULL,
`netid` TEXT NOT NULL,
`salt` BLOB NOT NULL,
`netid_passwd` BLOB NOT NULL,
`payment_passwd` BLOB NOT NULL
);
CREATE TABLE IF NOT EXISTS `reservations` (
`uid` INTEGER NOT NULL PRIMARY KEY,
`user` TEXT NOT NULL,
`date` TEXT NOT NULL,
`site` INTEGER NOT NULL,
`preferences` TEXT NOT NULL,
`priority` INTEGER NOT NULL,
`reserve_on` TEXT NOT NULL,
`status_code` INTEGER NOT NULL DEFAULT 0,
`msg` TEXT NOT NULL DEFAULT '',
`court_time` TEXT NOT NULL DEFAULT '{}',
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(`user`) REFERENCES `users`(`user`) ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `invitations` (
`code` TEXT NOT NULL PRIMARY KEY
);