Online-TicTacToe

Log | Files | Refs | README | LICENSE

tictactoe.sql (3972B)


      1 
      2 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
      3 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
      4 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
      5 /*!40101 SET NAMES utf8 */;
      6 /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
      7 /*!40103 SET TIME_ZONE='+00:00' */;
      8 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
      9 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
     10 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
     11 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
     12 
     13 DROP DATABASE IF EXISTS tictactoe;
     14 CREATE DATABASE tictactoe;
     15 USE tictactoe;
     16 
     17 --
     18 -- Table structure for table `users`
     19 --
     20 
     21 DROP TABLE IF EXISTS `users`;
     22 /*!40101 SET @saved_cs_client     = @@character_set_client */;
     23 /*!40101 SET character_set_client = utf8 */;
     24 CREATE TABLE `users` (
     25   `autokey` int(11) NOT NULL AUTO_INCREMENT,
     26   `name` varchar(50) NOT NULL,
     27   `surname` varchar(50) DEFAULT NULL,
     28   `username` varchar(25) NOT NULL,
     29   `password` varchar(255) NOT NULL,
     30   `isactive` tinyint(4) DEFAULT '0',
     31   `registered` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     32   PRIMARY KEY (`autokey`)
     33 ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
     34 /*!40101 SET character_set_client = @saved_cs_client */;
     35 
     36 --
     37 -- Dumping data for table `users`
     38 --
     39 
     40 LOCK TABLES `users` WRITE;
     41 /*!40000 ALTER TABLE `users` DISABLE KEYS */;
     42 INSERT INTO `users` VALUES (1,'John','Doe','johnD96','79a7eaf60787bf0a9eb73e7b8c92e428906df538',1,'2023-11-22 09:21:53');
     43 /*!40000 ALTER TABLE `users` ENABLE KEYS */;
     44 UNLOCK TABLES;
     45 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
     46 
     47 --
     48 -- Table structure for table `games`
     49 --
     50 
     51 DROP TABLE IF EXISTS `games`;
     52 /*!40101 SET @saved_cs_client     = @@character_set_client */;
     53 /*!40101 SET character_set_client = utf8 */;
     54 CREATE TABLE `games` (
     55   `autokey` int(11) NOT NULL AUTO_INCREMENT,
     56   `p1` int(11) DEFAULT NULL,
     57   `p2` int(11) DEFAULT NULL,
     58   `gamestate` tinyint(4) DEFAULT '0',
     59   `started` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     60   PRIMARY KEY (`autokey`),
     61   KEY `p1` (`p1`),
     62   KEY `p2` (`p2`),
     63   CONSTRAINT `games_ibfk_1` FOREIGN KEY (`p1`) REFERENCES `users` (`autokey`),
     64   CONSTRAINT `games_ibfk_2` FOREIGN KEY (`p2`) REFERENCES `users` (`autokey`)
     65 ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
     66 /*!40101 SET character_set_client = @saved_cs_client */;
     67 
     68 --
     69 -- Dumping data for table `games`
     70 --
     71 
     72 LOCK TABLES `games` WRITE;
     73 /*!40000 ALTER TABLE `games` DISABLE KEYS */;
     74 /*!40000 ALTER TABLE `games` ENABLE KEYS */;
     75 UNLOCK TABLES;
     76 
     77 --
     78 -- Table structure for table `moves`
     79 --
     80 
     81 DROP TABLE IF EXISTS `moves`;
     82 /*!40101 SET @saved_cs_client     = @@character_set_client */;
     83 /*!40101 SET character_set_client = utf8 */;
     84 CREATE TABLE `moves` (
     85   `autokey` int(11) NOT NULL AUTO_INCREMENT,
     86   `pId` int(11) DEFAULT NULL,
     87   `x` int(11) DEFAULT NULL,
     88   `y` int(11) DEFAULT NULL,
     89   `played` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
     90   `gId` int(11) DEFAULT NULL,
     91   PRIMARY KEY (`autokey`),
     92   KEY `pId` (`pId`),
     93   KEY `gId` (`gId`),
     94   CONSTRAINT `moves_ibfk_1` FOREIGN KEY (`pId`) REFERENCES `users` (`autokey`),
     95   CONSTRAINT `moves_ibfk_2` FOREIGN KEY (`gId`) REFERENCES `games` (`autokey`)
     96 ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
     97 /*!40101 SET character_set_client = @saved_cs_client */;
     98 
     99 --
    100 -- Dumping data for table `moves`
    101 --
    102 
    103 LOCK TABLES `moves` WRITE;
    104 /*!40000 ALTER TABLE `moves` DISABLE KEYS */;
    105 /*!40000 ALTER TABLE `moves` ENABLE KEYS */;
    106 UNLOCK TABLES;
    107 
    108 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
    109 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
    110 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
    111 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
    112 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
    113 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
    114 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
    115