@@ -36,7 +36,7 @@ CREATE TABLE `levels` (
3636 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
3737 ` active` tinyint (1 ) NOT NULL ,
3838 ` type` varchar (4 ) NOT NULL ,
39- ` title` text NOT NULL ,
39+ ` title` varchar ( 255 ) NOT NULL ,
4040 ` description` text NOT NULL ,
4141 ` entity_id` int (11 ) NOT NULL ,
4242 ` category_id` int (11 ) NOT NULL ,
@@ -48,7 +48,9 @@ CREATE TABLE `levels` (
4848 ` hint` text NOT NULL ,
4949 ` penalty` int (11 ) NOT NULL ,
5050 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
51- PRIMARY KEY (` id` )
51+ PRIMARY KEY (` id` ),
52+ KEY ` entity_id` (` entity_id` ),
53+ KEY ` active` (` active` )
5254) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
5355/* !40101 SET character_set_client = @saved_cs_client */ ;
5456
@@ -61,7 +63,7 @@ DROP TABLE IF EXISTS `categories`;
6163/* !40101 SET character_set_client = utf8 */ ;
6264CREATE TABLE `categories ` (
6365 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
64- ` category` text NOT NULL ,
66+ ` category` varchar ( 255 ) NOT NULL ,
6567 ` protected` tinyint (1 ) NOT NULL ,
6668 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
6769 PRIMARY KEY (` id` )
@@ -116,16 +118,18 @@ DROP TABLE IF EXISTS `teams`;
116118CREATE TABLE `teams ` (
117119 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
118120 ` active` tinyint (1 ) NOT NULL DEFAULT 1 ,
119- ` name` text NOT NULL ,
120- ` password_hash` text NOT NULL ,
121+ ` name` varchar ( 255 ) NOT NULL ,
122+ ` password_hash` varchar ( 255 ) NOT NULL ,
121123 ` points` int (11 ) NOT NULL DEFAULT 0 ,
122124 ` last_score` timestamp NOT NULL ,
123125 ` logo` text NOT NULL ,
124126 ` admin` tinyint (1 ) NOT NULL DEFAULT 0 ,
125127 ` protected` tinyint (1 ) NOT NULL DEFAULT 0 ,
126128 ` visible` tinyint (1 ) NOT NULL DEFAULT 1 ,
127129 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
128- PRIMARY KEY (` id` )
130+ PRIMARY KEY (` id` ),
131+ KEY ` visible` (` visible` ),
132+ KEY ` active` (` active` )
129133) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
130134/* !40101 SET character_set_client = @saved_cs_client */ ;
131135
@@ -146,6 +150,22 @@ CREATE TABLE `livesync` (
146150) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
147151/* !40101 SET character_set_client = @saved_cs_client */ ;
148152
153+ --
154+ -- Table structure for table `teams_oauth`
155+ --
156+
157+ DROP TABLE IF EXISTS ` teams_oauth` ;
158+ /* !40101 SET @saved_cs_client = @@character_set_client */ ;
159+ /* !40101 SET character_set_client = utf8 */ ;
160+ CREATE TABLE `teams_oauth ` (
161+ ` id` int (11 ) NOT NULL AUTO_INCREMENT,
162+ ` type` text NOT NULL ,
163+ ` team_id` int (11 ) NOT NULL ,
164+ ` token` text NOT NULL ,
165+ PRIMARY KEY (` id` )
166+ ) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
167+ /* !40101 SET character_set_client = @saved_cs_client */ ;
168+
149169--
150170-- Table structure for table `teams_data`
151171--
@@ -156,10 +176,11 @@ DROP TABLE IF EXISTS `teams_data`;
156176CREATE TABLE `teams_data ` (
157177 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
158178 ` team_id` int (11 ) NOT NULL ,
159- ` name` text NOT NULL ,
160- ` email` text NOT NULL ,
179+ ` name` varchar ( 255 ) NOT NULL ,
180+ ` email` varchar ( 255 ) NOT NULL ,
161181 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
162- PRIMARY KEY (` id` )
182+ PRIMARY KEY (` id` ),
183+ KEY ` team_id` (` team_id` )
163184) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
164185/* !40101 SET character_set_client = @saved_cs_client */ ;
165186
@@ -172,13 +193,14 @@ DROP TABLE IF EXISTS `sessions`;
172193/* !40101 SET character_set_client = utf8 */ ;
173194CREATE TABLE `sessions ` (
174195 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
175- ` cookie` text NOT NULL ,
196+ ` cookie` varchar ( 200 ) NOT NULL ,
176197 ` data` text NOT NULL ,
177198 ` team_id` int (11 ) NOT NULL ,
178199 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
179200 ` last_access_ts` timestamp NOT NULL ,
180- ` last_page_access` text NOT NULL ,
181- PRIMARY KEY (` id` )
201+ ` last_page_access` varchar (200 ) NOT NULL ,
202+ PRIMARY KEY (` id` ),
203+ KEY ` cookie` (` cookie` )
182204) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
183205/* !40101 SET character_set_client = @saved_cs_client */ ;
184206
@@ -215,17 +237,25 @@ INSERT INTO `configuration` (field, value, description) VALUES("auto_announce",
215237INSERT INTO ` configuration` (field, value, description) VALUES (" progressive_cycle" , " 300" , " (Integer) Frequency to take progressive scoreboard in seconds" );
216238INSERT INTO ` configuration` (field, value, description) VALUES (" bases_cycle" , " 5" , " (Integer) Frequency to score base levels in seconds" );
217239INSERT INTO ` configuration` (field, value, description) VALUES (" autorun_cycle" , " 30" , " (Integer) Frequency to cycle autorun in seconds" );
240+ INSERT INTO ` configuration` (field, value, description) VALUES (" gameboard_cycle" , " 5" , " (Integer) Frequency to cycle gameboard in seconds" );
241+ INSERT INTO ` configuration` (field, value, description) VALUES (" conf_cycle" , " 10" , " (Integer) Frequency to cycle configuration and commandline in seconds" );
242+ INSERT INTO ` configuration` (field, value, description) VALUES (" leaderboard_limit" , " 50" , " (Integer) Maximum number of teams to show on the leaderboard" );
218243INSERT INTO ` configuration` (field, value, description) VALUES (" registration" , " 0" , " (Boolean) Ability to register teams" );
219244INSERT INTO ` configuration` (field, value, description) VALUES (" registration_names" , " 0" , " (Boolean) Registration will ask for names" );
220245INSERT INTO ` configuration` (field, value, description) VALUES (" registration_type" , " 1" , " (Integer) Type of registration: 1 - Open; 2 - Tokenized;" );
221246INSERT INTO ` configuration` (field, value, description) VALUES (" registration_players" , " 3" , " (Integer) Number of players per team" );
247+ INSERT INTO ` configuration` (field, value, description) VALUES (" registration_facebook" , " 0" , " (Boolean) Allow Facebook Registration" );
248+ INSERT INTO ` configuration` (field, value, description) VALUES (" registration_google" , " 0" , " (Boolean) Allow Google Registration" );
249+ INSERT INTO ` configuration` (field, value, description) VALUES (" registration_prefix" , " Hacker" , " (String) Automated Team Registation Name Prefix" );
222250INSERT INTO ` configuration` (field, value, description) VALUES (" ldap" , " 0" , " (Boolean) Ability to use LDAP to login" );
223251INSERT INTO ` configuration` (field, value, description) VALUES (" ldap_server" , " ldap://localhost" , " (String) LDAP Server" );
224252INSERT INTO ` configuration` (field, value, description) VALUES (" ldap_port" , " 389" , " (Integer) LDAP Port" );
225253INSERT INTO ` configuration` (field, value, description) VALUES (" ldap_domain_suffix" , " @localhost" , " (String) LDAP Domain" );
226254INSERT INTO ` configuration` (field, value, description) VALUES (" login" , " 1" , " (Boolean) Ability to login" );
227255INSERT INTO ` configuration` (field, value, description) VALUES (" login_select" , " 0" , " (Boolean) Login selecting the team" );
228256INSERT INTO ` configuration` (field, value, description) VALUES (" login_strongpasswords" , " 0" , " (Boolean) Enforce using strong passwords" );
257+ INSERT INTO ` configuration` (field, value, description) VALUES (" login_facebook" , " 0" , " (Boolean) Allow Facebook Login" );
258+ INSERT INTO ` configuration` (field, value, description) VALUES (" login_google" , " 0" , " (Boolean) Allow Google Login" );
229259INSERT INTO ` configuration` (field, value, description) VALUES (" password_type" , " 1" , " (Integer) Type of passwords: See table password_types" );
230260INSERT INTO ` configuration` (field, value, description) VALUES (" default_bonus" , " 30" , " (Integer) Default value for bonus in levels" );
231261INSERT INTO ` configuration` (field, value, description) VALUES (" default_bonusdec" , " 10" , " (Integer) Default bonus decrement in levels" );
@@ -291,12 +321,13 @@ DROP TABLE IF EXISTS `registration_tokens`;
291321/* !40101 SET character_set_client = utf8 */ ;
292322CREATE TABLE `registration_tokens ` (
293323 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
294- ` token` text NOT NULL ,
324+ ` token` varchar ( 250 ) NOT NULL ,
295325 ` used` tinyint (1 ) NOT NULL ,
296326 ` team_id` int (11 ) NOT NULL ,
297327 ` created_ts` timestamp NOT NULL DEFAULT 0 ,
298328 ` use_ts` timestamp NOT NULL ,
299- PRIMARY KEY (` id` )
329+ PRIMARY KEY (` id` ),
330+ KEY ` token` (` token` )
300331) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
301332/* !40101 SET character_set_client = @saved_cs_client */ ;
302333
@@ -314,7 +345,9 @@ CREATE TABLE `scores_log` (
314345 ` points` int (11 ) NOT NULL ,
315346 ` level_id` int (11 ) NOT NULL ,
316347 ` type` varchar (4 ) NOT NULL ,
317- PRIMARY KEY (` id` )
348+ PRIMARY KEY (` id` ),
349+ KEY ` level_id` (` level_id` ),
350+ KEY ` team_id` (` team_id` )
318351) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
319352/* !40101 SET character_set_client = @saved_cs_client */ ;
320353
@@ -331,7 +364,8 @@ CREATE TABLE `bases_log` (
331364 ` code` int (11 ) NOT NULL ,
332365 ` response` text NOT NULL ,
333366 ` level_id` int (11 ) NOT NULL ,
334- PRIMARY KEY (` id` )
367+ PRIMARY KEY (` id` ),
368+ KEY ` level_id` (` level_id` )
335369) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
336370/* !40101 SET character_set_client = @saved_cs_client */ ;
337371
@@ -344,12 +378,16 @@ DROP TABLE IF EXISTS `scripts`;
344378/* !40101 SET character_set_client = utf8 */ ;
345379CREATE TABLE `scripts ` (
346380 ` id` int (11 ) NOT NULL AUTO_INCREMENT,
381+ ` host` varchar (1024 ) NOT NULL ,
347382 ` ts` timestamp NULL ,
348383 ` pid` int (11 ) NOT NULL ,
349- ` name` text NOT NULL ,
384+ ` name` varchar ( 255 ) NOT NULL ,
350385 ` cmd` text NOT NULL ,
351386 ` status` tinyint (1 ) NOT NULL ,
352- PRIMARY KEY (` id` )
387+ PRIMARY KEY (` id` ),
388+ KEY ` host` (` host` ),
389+ KEY ` status` (` status` ),
390+ KEY ` name` (` name` )
353391) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
354392/* !40101 SET character_set_client = @saved_cs_client */ ;
355393
@@ -366,7 +404,9 @@ CREATE TABLE `failures_log` (
366404 ` team_id` int (11 ) NOT NULL ,
367405 ` level_id` int (11 ) NOT NULL ,
368406 ` flag` text NOT NULL ,
369- PRIMARY KEY (` id` )
407+ PRIMARY KEY (` id` ),
408+ KEY ` team_id` (` team_id` ),
409+ KEY ` level_id` (` level_id` )
370410) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
371411/* !40101 SET character_set_client = @saved_cs_client */ ;
372412
@@ -383,7 +423,9 @@ CREATE TABLE `hints_log` (
383423 ` level_id` int (11 ) NOT NULL ,
384424 ` team_id` int (11 ) NOT NULL ,
385425 ` penalty` int (11 ) NOT NULL ,
386- PRIMARY KEY (` id` )
426+ PRIMARY KEY (` id` ),
427+ KEY ` level_id` (` level_id` ),
428+ KEY ` team_id` (` team_id` )
387429) ENGINE= InnoDB AUTO_INCREMENT= 1 DEFAULT CHARSET= latin1;
388430/* !40101 SET character_set_client = @saved_cs_client */ ;
389431
0 commit comments