From f7aeeb0c0ed76c383c77bac06831400bb8623fc2 Mon Sep 17 00:00:00 2001 From: Gnieark Date: Thu, 9 Jun 2016 14:41:24 +0200 Subject: [PATCH] Change database structure --- install.sql | 67 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 18 deletions(-) diff --git a/install.sql b/install.sql index b1e125f..c4bda2e 100644 --- a/install.sql +++ b/install.sql @@ -1,33 +1,64 @@ -CREATE TABLE `arena_history` ( + +-- +-- Structure de la table `arena_history` +-- + +CREATE TABLE IF NOT EXISTS `arena_history` ( `game` varchar(8) NOT NULL, `player1_id` int(11) NOT NULL, `player2_id` int(11) NOT NULL, `player1_winsCount` int(11) NOT NULL, `player2_winsCount` int(11) NOT NULL, `nulCount` int(11) NOT NULL, - PRIMARY KEY (`game`,`player1_id`,`player2_id`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -LOCK TABLES `arena_history` WRITE; -/*!40000 ALTER TABLE `arena_history` DISABLE KEYS */; -INSERT INTO `arena_history` VALUES ('Battlesh',10,10,173,438,0),('tictacto',1,1,0,0,44),('tictacto',1,2,46,0,2),('tictacto',1,3,23,0,47),('tictacto',2,1,0,20,4),('tictacto',2,3,0,5,0),('tictacto',3,1,0,0,6),('tictacto',3,2,2,0,0),('tictacto',3,3,3,0,0); -/*!40000 ALTER TABLE `arena_history` ENABLE KEYS */; -UNLOCK TABLES; -DROP TABLE IF EXISTS `bots`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `bots` ( + PRIMARY KEY (`game`,`player1_id`,`player2_id`) +); + + +-- +-- Structure de la table `bots` +-- + +CREATE TABLE IF NOT EXISTS `bots` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, `game` varchar(10) NOT NULL, `url` text NOT NULL, `description` text NOT NULL, + `unclean_description` text NOT NULL, `active` int(1) NOT NULL, `date_inscription` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `validate_secret` varchar(8) NOT NULL, + `author_email` text NOT NULL, PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; -LOCK TABLES `bots` WRITE; -/*!40000 ALTER TABLE `bots` DISABLE KEYS */; -INSERT INTO `bots` VALUES (1,'moul','tictactoe','http://tictactoe.m.42.am/','moul\'s Tic Tac Toe resolver in Golang. Open sourced using Minimax algorithm',1,'2015-12-03 10:55:34',''),(2,'stupidAI','tictactoe','http://morpionmaster.tinad.fr/stupidIa.php','A PHP script that choose next case by... random. By Gnieark, here on github',1,'2015-12-03 10:55:34',''),(3,'Gnieark','tictactoe','http://morpionmaster.tinad.fr/gnieark.php','Gnieark\'s PHP AI, using minmax algorythm. Published on github',1,'2015-12-03 10:55:34',''),(10,'stupidIA','Battleship','https://botsArena.tinad.fr/StupidIABattleship.php','',1,'2015-12-11 11:16:50','!!!'); -/*!40000 ALTER TABLE `bots` ENABLE KEYS */; -UNLOCK TABLES; +); + +-- +-- Contenu de la table `bots` only stupid ias +-- + +INSERT INTO `bots` (`id`, `name`, `game`, `url`, `description`, `unclean_description`, `active`, `date_inscription`, `validate_secret`, `author_email`) VALUES +(2, 'stupidAI', 'tictactoe', 'https://ias.tinad.fr/stupidIATictactoe.php', '', '', 1, '2015-12-03 10:55:34', '', ''), +(3, 'stupidAI', 'Battleship', 'https://botsArena.tinad.fr/StupidIABattleship.php', '', '', 1, '2015-12-11 11:16:50', '', ''), +(4, 'stupidAI', 'connectFou', 'https://ias.tinad.fr/StupidIAconnectFour.php', '', '', 1, '2016-05-11 07:47:57', '', ''); + +-- -------------------------------------------------------- + +-- +-- Structure de la table `bots_modifs` +-- + +CREATE TABLE IF NOT EXISTS `bots_modifs` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `real_id` int(11) NOT NULL, + `name` text NOT NULL, + `game` varchar(10) NOT NULL, + `url` text NOT NULL, + `description` text NOT NULL, + `unclean_description` text NOT NULL, + `date_modification` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `validate_secret` varchar(8) NOT NULL, + `author_email` text NOT NULL, + PRIMARY KEY (`id`); +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +