-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
96 lines (84 loc) · 2.44 KB
/
schema.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
-- drop table ips;
drop table bans;
drop table whitelist;
drop table approvals;
drop table applications;
drop table members;
drop table servers;
drop table application_type;
drop table mcaccounts;
create table application_type(
application_type varchar(50),
primary key(application_type)
);
create table servers(
server_type varchar(50),
primary key(server_type)
);
create table mcaccounts(
id bigint auto_increment unique,
name varchar(100),
uuid char(36),
primary key(id)
);
create table members(
id bigint auto_increment unique,
discord_id varchar(100),
discord_name varchar(250),
mcaccount bigint,
primary key(id),
foreign key(mcaccount) references mcaccounts(id)
);
create table applications(
id bigint auto_increment unique,
member bigint,
server_type varchar(50),
application_type varchar(50),
application_date timestamp default current_timestamp,
primary key(id),
foreign key(member) references members(id),
foreign key(server_type) references servers(server_type),
foreign key(application_type) references application_type(application_type)
);
create table approvals(
id bigint auto_increment unique,
application_id bigint,
approver bigint,
approval_date timestamp default current_timestamp,
primary key(id),
foreign key(application_id) references applications(id),
foreign key(approver) references members(id)
);
create table whitelist(
id bigint auto_increment unique,
member bigint,
server_type varchar(50),
mcaccount bigint,
primary key(id),
foreign key(member) references members(id),
foreign key(server_type) references servers(server_type),
foreign key(mcaccount) references mcaccounts(id)
);
create table bans(
id bigint auto_increment unique,
member bigint,
mcaccount bigint,
reason text,
bandate timestamp default current_timestamp,
primary key(id),
foreign key(member) references members(id),
foreign key(mcaccount) references mcaccounts(id)
);
-- create table ips(
-- id bigint auto_increment unique,
-- member bigint,
-- ip varchar(50),
-- primary key(id),
-- foreign key(member) references members(id)
-- );
insert into application_type values("Pending");
insert into application_type values("Approved");
insert into application_type values("Denied");
insert into servers values("Vanilla");
insert into servers values("Modded");
insert into servers values("Both");