-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_database.sql
More file actions
42 lines (38 loc) · 947 Bytes
/
setup_database.sql
File metadata and controls
42 lines (38 loc) · 947 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
30
31
32
33
34
35
36
37
38
39
40
41
42
create table page-data (
id INT UNIQUE AUTO INCREMENT,
data LONGTEXT,
PRIMARY KEY(id)
) engine=InnoDB;
create table page-name (
id INT UNIQUE AUTO INCREMENT,
name VARCHAR(255) UNIQUE,
data INT,
headers INT,
PRIMARY KEY(id),
KEY(name),
FOREIGN KEY(data) REFERENCES page-data(id),
FOREIGN KEY(headers) REFERENCES page-data(id)
) engine=InnoDB;
create table page-variables (
id INT UNIQUE AUTO INCREMENT,
name VARCHAR(255),
value MEDIUMTEXT,
PRIMARY KEY(id)
) engine=InnoDB;
create table name-variable-interp (
id INT UNIQUE AUTO INCREMENT,
page-name INT,
variable INT,
PRIMARY KEY(id),
FOREIGN KEY(page-name) REFERENCES page-name(id),
FOREIGN KEY(variable) REFERENCES page-variables(id)
) engine=InnoDB;
create table users (
id INT AUTO INCREMENT UNIQUE,
username VARCHAR(255) UNIQUE,
password VARCHAR(512),
contact VARCHAR(255),
flags INT,
PRIMARY KEY(id),
KEY(username)
) engine=InnoDB;