text: -- MySQL dump 10.13  Distrib 8.0.21, for macos10.15 (x86_64)
  --
  -- Host: 127.0.0.1    Database: test-db
  -- ------------------------------------------------------
  -- Server version	5.7.24
  
  /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  /*!50503 SET NAMES utf8 */;
  /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  /*!40103 SET TIME_ZONE='+00:00' */;
  /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  
  --
  -- Table structure for table `aliases`
  --
  
  DROP TABLE IF EXISTS `aliases`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `aliases` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `playerId` int(11) NOT NULL,
    `value` varchar(45) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `cards`
  --
  
  DROP TABLE IF EXISTS `cards`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `cards` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `roundId` int(11) NOT NULL,
    `authorId` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `courseHoles`
  --
  
  DROP TABLE IF EXISTS `courseHoles`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `courseHoles` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `courseLayoutId` int(11) NOT NULL,
    `number` int(11) NOT NULL,
    `distance` int(11) NOT NULL,
    `par` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_courseLayout_idx` (`courseLayoutId`),
    CONSTRAINT `fk_courseLayout` FOREIGN KEY (`courseLayoutId`) REFERENCES `courseLayouts` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=154 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `courseLayouts`
  --
  
  DROP TABLE IF EXISTS `courseLayouts`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `courseLayouts` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `courseId` int(11) NOT NULL,
    `name` varchar(256) NOT NULL,
    `dgcrSse` double DEFAULT NULL,
    `par` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `fk_courses_idx` (`courseId`),
    CONSTRAINT `fk_courses` FOREIGN KEY (`courseId`) REFERENCES `courses` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
  ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `courses`
  --
  
  DROP TABLE IF EXISTS `courses`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `courses` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(256) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `events`
  --
  
  DROP TABLE IF EXISTS `events`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `events` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `seasonId` int(11) NOT NULL,
    `name` varchar(45) NOT NULL,
    `startDate` datetime DEFAULT NULL,
    `description` longtext,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `playerGroupPlayers`
  --
  
  DROP TABLE IF EXISTS `playerGroupPlayers`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `playerGroupPlayers` (
    `playerGroupId` int(11) NOT NULL,
    `playerId` int(11) NOT NULL,
    PRIMARY KEY (`playerId`,`playerGroupId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `playerGroupResults`
  --
  
  DROP TABLE IF EXISTS `playerGroupResults`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `playerGroupResults` (
    `playerGroupId` int(11) NOT NULL,
    `courseHoleId` int(11) NOT NULL,
    `score` int(11) DEFAULT NULL,
    PRIMARY KEY (`playerGroupId`,`courseHoleId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `playerGroups`
  --
  
  DROP TABLE IF EXISTS `playerGroups`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `playerGroups` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `cardId` int(11) NOT NULL,
    `teamName` varchar(128) DEFAULT NULL,
    `score` int(11) DEFAULT NULL,
    `par` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `playerRatings`
  --
  
  DROP TABLE IF EXISTS `playerRatings`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `playerRatings` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `playerId` int(11) NOT NULL,
    `cardId` int(11) NOT NULL,
    `date` datetime NOT NULL,
    `rating` int(11) NOT NULL,
    `type` tinyint(4) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `players`
  --
  
  DROP TABLE IF EXISTS `players`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `players` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `firstName` varchar(45) NOT NULL,
    `lastName` varchar(45) NOT NULL,
    `currentRating` int(11) DEFAULT 0,
    `bio` text,
    `yearJoined` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `profiles`
  --
  
  DROP TABLE IF EXISTS `profiles`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `profiles` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `firstName` varchar(45) NOT NULL,
    `lastName` varchar(45) NOT NULL,
    `currentRating` int(11) NOT NULL DEFAULT '0',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `rounds`
  --
  
  DROP TABLE IF EXISTS `rounds`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `rounds` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `eventId` int(11) DEFAULT NULL,
    `courseId` int(11) NOT NULL,
    `courseLayoutId` int(11) NOT NULL,
    `name` varchar(45) DEFAULT NULL,
    `isComplete` tinyint(4) DEFAULT '0',
    PRIMARY KEY (`id`),
    KEY `fk_events_idx` (`eventId`)
  ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `seasons`
  --
  
  DROP TABLE IF EXISTS `seasons`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `seasons` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(45) NOT NULL,
    `startDate` datetime NOT NULL,
    `endDate` datetime NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `userRoles`
  --
  
  DROP TABLE IF EXISTS `userRoles`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `userRoles` (
    `userId` int(11) NOT NULL,
    `roleId` int(11) NOT NULL,
    PRIMARY KEY (`userId`,`roleId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Table structure for table `users`
  --
  
  DROP TABLE IF EXISTS `users`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!50503 SET character_set_client = utf8mb4 */;
  CREATE TABLE `users` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `email` varchar(128) NOT NULL,
    `passwordHash` varchar(256) NOT NULL,
    `passwordSalt` varchar(256) NOT NULL,
    `isAdmin` tinyint(1) DEFAULT '0',
    `playerId` int(11) DEFAULT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `email_UNIQUE` (`email`)
  ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
  /*!40101 SET character_set_client = @saved_cs_client */;
  /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  
  /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  
  -- Dump completed on 2021-05-05  8:28:53
  