-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debating.sql
164 lines (128 loc) · 4.52 KB
/
debating.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `config` (
`id` int(11) NOT NULL,
`wettbewerb_aktiv` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `config` (`id`, `wettbewerb_aktiv`) VALUES
(1, 0);
CREATE TABLE `contact` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`subject` varchar(255) NOT NULL,
`message` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `dates` (
`id` int(11) NOT NULL,
`competition_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `dates` (`id`, `competition_date`) VALUES
(1, '1970-01-01');
CREATE TABLE `debates` (
`DebateID` int(11) NOT NULL,
`debate_round` int(11) NOT NULL,
`debate_room` int(11) NOT NULL,
`debate_pro_TeamID` int(11) NOT NULL,
`debate_pro_Player_1` int(11) NOT NULL,
`debate_pro_Player_2` int(11) NOT NULL,
`debate_pro_Player_3` int(11) NOT NULL,
`debate_pro_Player_reply` int(11) NOT NULL,
`debate_points_pro_Player_1` float NOT NULL,
`debate_points_pro_Player_2` float NOT NULL,
`debate_points_pro_Player_3` float NOT NULL,
`debate_points_pro_Player_reply` float NOT NULL,
`debate_con_TeamID` int(11) NOT NULL,
`debate_con_Player_1` int(11) NOT NULL,
`debate_con_Player_2` int(11) NOT NULL,
`debate_con_Player_3` int(11) NOT NULL,
`debate_con_Player_reply` int(11) NOT NULL,
`debate_points_con_Player_1` float NOT NULL,
`debate_points_con_Player_2` float NOT NULL,
`debate_points_con_Player_3` float NOT NULL,
`debate_points_con_Player_reply` float NOT NULL,
`debate_bestplayer_ID` int(11) NOT NULL,
`debate_winner_TeamID` int(11) NOT NULL,
`debates_submitterID` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `host` (
`name` text NOT NULL,
`ID` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO `host` (`name`, `ID`) VALUES
('[Add Schoolname via Admintool]', 1);
CREATE TABLE `players` (
`PlayerID` int(11) NOT NULL,
`TeamID` int(11) NOT NULL,
`player_name` text NOT NULL,
`player_points` float NOT NULL DEFAULT '0',
`player_Max_points` float NOT NULL DEFAULT '0',
`player_wins` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `rooms` (
`ID` int(11) NOT NULL,
`Room_Name` text NOT NULL,
`Room_ID` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `teams` (
`Team_ID` int(11) NOT NULL,
`team_name` text NOT NULL,
`team_school` text NOT NULL,
`team_points` float NOT NULL DEFAULT '0',
`team_wins` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `users` (`id`, `username`, `password`) VALUES
(1, 'root', '$2y$10$vOnuLHSWS5GOxiSjYIQA7.40pYKOBmeMviQeg/x.a0ptx5K8D3VsW');
CREATE TABLE `users_admin` (
`id` int(11) NOT NULL,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `users_admin` (`id`, `username`, `password`) VALUES
(1, 'root', '$2y$10$vOnuLHSWS5GOxiSjYIQA7.40pYKOBmeMviQeg/x.a0ptx5K8D3VsW');
ALTER TABLE `config`
ADD PRIMARY KEY (`id`);
ALTER TABLE `contact`
ADD PRIMARY KEY (`id`);
ALTER TABLE `dates`
ADD PRIMARY KEY (`id`);
ALTER TABLE `debates`
ADD PRIMARY KEY (`DebateID`);
ALTER TABLE `host`
ADD PRIMARY KEY (`ID`);
ALTER TABLE `players`
ADD PRIMARY KEY (`PlayerID`);
ALTER TABLE `rooms`
ADD PRIMARY KEY (`ID`);
ALTER TABLE `teams`
ADD PRIMARY KEY (`Team_ID`);
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
ALTER TABLE `users_admin`
ADD PRIMARY KEY (`id`);
ALTER TABLE `contact`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `dates`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `debates`
MODIFY `DebateID` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `host`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `players`
MODIFY `PlayerID` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `rooms`
MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `teams`
MODIFY `Team_ID` int(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `users_admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
COMMIT;