forked from captrespect/hallway
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_tables.sql
More file actions
61 lines (56 loc) · 1.8 KB
/
create_tables.sql
File metadata and controls
61 lines (56 loc) · 1.8 KB
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
53
54
55
56
57
58
59
60
61
CREATE TABLE IF NOT EXISTS Apps (
app VARCHAR(255) PRIMARY KEY,
secret VARCHAR(255),
apikeys TEXT,
notes TEXT,
cat TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE `Owners` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`account` varchar(255) DEFAULT NULL,
`app` varchar(255) DEFAULT NULL,
`role` varchar(255) DEFAULT NULL,
`cat` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `account` (`account`)
);
CREATE TABLE IF NOT EXISTS Grants (
code VARCHAR(255) PRIMARY KEY,
account VARCHAR(255),
app VARCHAR(255),
pid VARCHAR(255),
cat TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS Accounts (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
account VARCHAR(255),
app VARCHAR(255),
profile VARCHAR(255),
cat TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
KEY `app` (`app`),
KEY `account` (`account`),
KEY `profile` (`profile`)
);
CREATE TABLE IF NOT EXISTS Profiles (
id VARCHAR(255) PRIMARY KEY,
service VARCHAR(32),
pod INT(11) UNSIGNED,
cat TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS `Entries` (
base binary(30) NOT NULL,
idr binary(16) NOT NULL,
path varchar(128) DEFAULT NULL,
hash varchar(32) DEFAULT NULL,
offset int(11) DEFAULT NULL,
len int(11) DEFAULT NULL,
lat decimal(8,5) DEFAULT NULL,
lng decimal(8,5) DEFAULT NULL,
q0 bigint(20) unsigned DEFAULT NULL,
q1 bigint(20) unsigned DEFAULT NULL,
q2 bigint(20) unsigned DEFAULT NULL,
q3 bigint(20) unsigned DEFAULT NULL,
par varbinary(16) DEFAULT NULL,
PRIMARY KEY (`base`),
UNIQUE KEY `idr_index` (`idr`)
) DEFAULT CHARSET=utf8;