Postgres Dump
Remove old Db dump
This commit is contained in:
@@ -1,237 +0,0 @@
|
|||||||
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
|
|
||||||
--
|
|
||||||
-- Host: localhost Database: ladoseapi
|
|
||||||
-- ------------------------------------------------------
|
|
||||||
-- Server version 5.6.40-log
|
|
||||||
|
|
||||||
/*!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 */;
|
|
||||||
/*!40101 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 `ApplicationUser`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `ApplicationUser`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `ApplicationUser` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`FirstName` varchar(45) DEFAULT NULL,
|
|
||||||
`LastName` varchar(45) DEFAULT NULL,
|
|
||||||
`UserName` varchar(45) DEFAULT NULL,
|
|
||||||
`PasswordHash` blob,
|
|
||||||
`PasswordSalt` blob,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `Event`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `Event`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `Event` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(255) NOT NULL,
|
|
||||||
`Date` datetime NOT NULL,
|
|
||||||
`SeasonId` int(11) NOT NULL,
|
|
||||||
`Ranking` tinyint(4) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `SeasonPK_idx` (`SeasonId`),
|
|
||||||
CONSTRAINT `SeasonsPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `EventGame`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `EventGame`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `EventGame` (
|
|
||||||
`EventId` int(11) NOT NULL,
|
|
||||||
`GameId` int(11) NOT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`ChallongeUrl` varchar(250) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`EventId`,`GameId`),
|
|
||||||
KEY `GamePK_idx` (`GameId`),
|
|
||||||
CONSTRAINT `EventGame_EventPK` FOREIGN KEY (`EventId`) REFERENCES `Event` (`Id`),
|
|
||||||
CONSTRAINT `EventGame_GamePk` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `Game`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `Game`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `Game` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
|
|
||||||
`ImgUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
|
|
||||||
`WordPressTag` varchar(255) DEFAULT NULL,
|
|
||||||
`WordPressTagOs` varchar(255) DEFAULT NULL,
|
|
||||||
`Order` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`Gamecol` varchar(45) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `Season`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `Season`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `Season` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`StartDate` datetime DEFAULT NULL,
|
|
||||||
`EndDate` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `Name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `SeasonGame`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `SeasonGame`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `SeasonGame` (
|
|
||||||
`SeasonId` int(11) NOT NULL,
|
|
||||||
`GameId` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`SeasonId`,`GameId`),
|
|
||||||
KEY `GamePK_idx` (`GameId`),
|
|
||||||
CONSTRAINT `GamePK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
||||||
CONSTRAINT `SeasonPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `Todo`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `Todo`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `Todo` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`User` varchar(45) NOT NULL,
|
|
||||||
`Task` mediumtext,
|
|
||||||
`Done` tinyint(4) NOT NULL DEFAULT '0',
|
|
||||||
`Created` datetime NOT NULL,
|
|
||||||
`Deleted` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `WPBooking`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `WPBooking`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `WPBooking` (
|
|
||||||
`WPEventId` int(11) DEFAULT NULL,
|
|
||||||
`WPUserId` int(11) DEFAULT NULL,
|
|
||||||
`Message` varchar(5000) DEFAULT NULL,
|
|
||||||
`Meta` varchar(5000) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `WPEvent`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `WPEvent`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `WPEvent` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(255) DEFAULT NULL,
|
|
||||||
`Slug` varchar(255) DEFAULT NULL,
|
|
||||||
`Date` date DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Table structure for table `WPUser`
|
|
||||||
--
|
|
||||||
|
|
||||||
DROP TABLE IF EXISTS `WPUser`;
|
|
||||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
||||||
/*!40101 SET character_set_client = utf8 */;
|
|
||||||
CREATE TABLE `WPUser` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`WPUserLogin` varchar(45) DEFAULT NULL,
|
|
||||||
`WPMail` varchar(45) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping events for database 'ladoseapi'
|
|
||||||
--
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Dumping routines for database 'ladoseapi'
|
|
||||||
--
|
|
||||||
/*!50003 DROP PROCEDURE IF EXISTS `ImportEvent` */;
|
|
||||||
/*!50003 SET @saved_cs_client = @@character_set_client */ ;
|
|
||||||
/*!50003 SET @saved_cs_results = @@character_set_results */ ;
|
|
||||||
/*!50003 SET @saved_col_connection = @@collation_connection */ ;
|
|
||||||
/*!50003 SET character_set_client = utf8 */ ;
|
|
||||||
/*!50003 SET character_set_results = utf8 */ ;
|
|
||||||
/*!50003 SET collation_connection = utf8_general_ci */ ;
|
|
||||||
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
|
|
||||||
/*!50003 SET sql_mode = 'NO_ENGINE_SUBSTITUTION' */ ;
|
|
||||||
DELIMITER ;;
|
|
||||||
CREATE DEFINER=`ladoseapi`@`%` PROCEDURE `ImportEvent`()
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO WPEvent (Id, Name,Slug,Date )
|
|
||||||
select event_id, event_name,event_slug, event_start_date from ladose.wp_em_events
|
|
||||||
where event_id not in (select Id from WPEvent);
|
|
||||||
|
|
||||||
INSERT INTO WPUser (Id, Name, WPUSerLogin, WPMail)
|
|
||||||
select ID, display_name, user_login , user_email from ladose.wp_users
|
|
||||||
where ID not in (select Id from WPUser);
|
|
||||||
|
|
||||||
INSERT INTO WPBooking (WPEventId, WPUserId, Message, Meta)
|
|
||||||
select event_id, person_id, booking_comment , booking_meta from ladose.wp_em_bookings
|
|
||||||
where (event_id , person_id) not in (select WPEventId,WPUserId from WPBooking);
|
|
||||||
END ;;
|
|
||||||
DELIMITER ;
|
|
||||||
/*!50003 SET sql_mode = @saved_sql_mode */ ;
|
|
||||||
/*!50003 SET character_set_client = @saved_cs_client */ ;
|
|
||||||
/*!50003 SET character_set_results = @saved_cs_results */ ;
|
|
||||||
/*!50003 SET collation_connection = @saved_col_connection */ ;
|
|
||||||
/*!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 2019-03-27 0:38:33
|
|
||||||
@@ -1,190 +0,0 @@
|
|||||||
-- --------------------------------------------------------
|
|
||||||
-- Hôte : api.ladose.net
|
|
||||||
-- Version du serveur: 5.7.25-log - Gentoo Linux mysql-5.7.25
|
|
||||||
-- SE du serveur: Linux
|
|
||||||
-- HeidiSQL Version: 10.2.0.5599
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET NAMES utf8 */;
|
|
||||||
/*!50503 SET NAMES utf8mb4 */;
|
|
||||||
/*!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' */;
|
|
||||||
|
|
||||||
|
|
||||||
-- Listage de la structure de la base pour ladoseapi
|
|
||||||
CREATE DATABASE IF NOT EXISTS `ladoseapi` /*!40100 DEFAULT CHARACTER SET utf8 */;
|
|
||||||
USE `ladoseapi`;
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. ApplicationUser
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationUser` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`FirstName` varchar(45) DEFAULT NULL,
|
|
||||||
`LastName` varchar(45) DEFAULT NULL,
|
|
||||||
`UserName` varchar(45) DEFAULT NULL,
|
|
||||||
`PasswordHash` blob,
|
|
||||||
`PasswordSalt` blob,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. ChallongeParticipent
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeParticipent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`ChallongeTournamentId` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`Name` varchar(500) NOT NULL DEFAULT '0',
|
|
||||||
`Rank` int(11) DEFAULT '0',
|
|
||||||
`IsMember` bit(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=687 DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. ChallongeTournament
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeTournament` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`Name` varchar(500) DEFAULT NULL,
|
|
||||||
`GameId` int(11) DEFAULT NULL,
|
|
||||||
`Url` varchar(255) DEFAULT NULL,
|
|
||||||
`Sync` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `ChallongeTournament_GameIdPK` (`GameId`),
|
|
||||||
CONSTRAINT `ChallongeTournament_GameIdPK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=48 DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. Event
|
|
||||||
CREATE TABLE IF NOT EXISTS `Event` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(255) NOT NULL,
|
|
||||||
`Date` datetime NOT NULL,
|
|
||||||
`SeasonId` int(11) NOT NULL,
|
|
||||||
`Ranking` tinyint(4) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `SeasonPK_idx` (`SeasonId`),
|
|
||||||
CONSTRAINT `SeasonsPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. EventGame
|
|
||||||
CREATE TABLE IF NOT EXISTS `EventGame` (
|
|
||||||
`EventId` int(11) NOT NULL,
|
|
||||||
`GameId` int(11) NOT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`ChallongeUrl` varchar(250) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`EventId`,`GameId`),
|
|
||||||
KEY `GamePK_idx` (`GameId`),
|
|
||||||
CONSTRAINT `EventGame_EventPK` FOREIGN KEY (`EventId`) REFERENCES `Event` (`Id`),
|
|
||||||
CONSTRAINT `EventGame_GamePk` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. Game
|
|
||||||
CREATE TABLE IF NOT EXISTS `Game` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
|
|
||||||
`ImgUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
|
|
||||||
`WordPressTag` varchar(255) DEFAULT NULL,
|
|
||||||
`WordPressTagOs` varchar(255) DEFAULT NULL,
|
|
||||||
`Order` int(11) NOT NULL DEFAULT '0',
|
|
||||||
`LongName` varchar(255) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la procédure ladoseapi. ImportEvent
|
|
||||||
DELIMITER //
|
|
||||||
CREATE DEFINER=`ladoseapi`@`%` PROCEDURE `ImportEvent`()
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO WPEvent (Id, Name,Slug,Date )
|
|
||||||
select event_id, event_name,event_slug, event_start_date from ladose.wp_em_events
|
|
||||||
where event_id not in (select Id from WPEvent);
|
|
||||||
|
|
||||||
INSERT INTO WPUser (Id, Name, WPUSerLogin, WPMail)
|
|
||||||
select ID, display_name, user_login , user_email from ladose.wp_users
|
|
||||||
where ID not in (select Id from WPUser);
|
|
||||||
|
|
||||||
INSERT INTO WPBooking (WPEventId, WPUserId, Message, Meta)
|
|
||||||
select event_id, person_id, booking_comment , booking_meta from ladose.wp_em_bookings
|
|
||||||
where (event_id , person_id) not in (select WPEventId,WPUserId from WPBooking);
|
|
||||||
END//
|
|
||||||
DELIMITER ;
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. Season
|
|
||||||
CREATE TABLE IF NOT EXISTS `Season` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`StartDate` datetime DEFAULT NULL,
|
|
||||||
`EndDate` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `Name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. SeasonGame
|
|
||||||
CREATE TABLE IF NOT EXISTS `SeasonGame` (
|
|
||||||
`SeasonId` int(11) NOT NULL,
|
|
||||||
`GameId` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`SeasonId`,`GameId`),
|
|
||||||
KEY `GamePK_idx` (`GameId`),
|
|
||||||
CONSTRAINT `GamePK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
|
|
||||||
CONSTRAINT `SeasonPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. Todo
|
|
||||||
CREATE TABLE IF NOT EXISTS `Todo` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`User` varchar(45) NOT NULL,
|
|
||||||
`Task` mediumtext,
|
|
||||||
`Done` tinyint(4) NOT NULL DEFAULT '0',
|
|
||||||
`Created` datetime NOT NULL,
|
|
||||||
`Deleted` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. WPBooking
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPBooking` (
|
|
||||||
`WPEventId` int(11) DEFAULT NULL,
|
|
||||||
`WPUserId` int(11) DEFAULT NULL,
|
|
||||||
`Message` varchar(5000) DEFAULT NULL,
|
|
||||||
`Meta` varchar(5000) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. WPEvent
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPEvent` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(255) DEFAULT NULL,
|
|
||||||
`Slug` varchar(255) DEFAULT NULL,
|
|
||||||
`Date` date DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
-- Listage de la structure de la table ladoseapi. WPUser
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPUser` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`WPUserLogin` varchar(45) DEFAULT NULL,
|
|
||||||
`WPMail` varchar(45) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
||||||
|
|
||||||
-- Les données exportées n'étaient pas sélectionnées.
|
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
@@ -1,264 +0,0 @@
|
|||||||
-- --------------------------------------------------------
|
|
||||||
-- Host: 192.168.20.36
|
|
||||||
-- Server version: 10.7.3-MariaDB - Arch Linux
|
|
||||||
-- Server OS: Linux
|
|
||||||
-- HeidiSQL Version: 10.2.0.5599
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET NAMES utf8 */;
|
|
||||||
/*!50503 SET NAMES utf8mb4 */;
|
|
||||||
/*!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' */;
|
|
||||||
|
|
||||||
|
|
||||||
-- Dumping database structure for ladoseapi
|
|
||||||
CREATE DATABASE IF NOT EXISTS `ladoseapi` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
|
|
||||||
USE `ladoseapi`;
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationRole
|
|
||||||
DROP TABLE IF EXISTS `ApplicationRole`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationRole` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(50) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationUser
|
|
||||||
DROP TABLE IF EXISTS `ApplicationUser`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationUser` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`FirstName` varchar(45) DEFAULT NULL,
|
|
||||||
`LastName` varchar(45) DEFAULT NULL,
|
|
||||||
`UserName` varchar(45) DEFAULT NULL,
|
|
||||||
`PasswordHash` blob DEFAULT NULL,
|
|
||||||
`PasswordSalt` blob DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationUserRole
|
|
||||||
DROP TABLE IF EXISTS `ApplicationUserRole`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationUserRole` (
|
|
||||||
`UserId` int(11) NOT NULL,
|
|
||||||
`RoleId` int(11) NOT NULL,
|
|
||||||
UNIQUE KEY `UserId_RoleId` (`UserId`,`RoleId`),
|
|
||||||
KEY `FK_ApplicationUserRole_ApplicationRole` (`RoleId`),
|
|
||||||
CONSTRAINT `FK_ApplicationUserRole_ApplicationRole` FOREIGN KEY (`RoleId`) REFERENCES `ApplicationRole` (`Id`),
|
|
||||||
CONSTRAINT `FK_ApplicationUserRole_ApplicationUser` FOREIGN KEY (`UserId`) REFERENCES `ApplicationUser` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ChallongeParticipent
|
|
||||||
DROP TABLE IF EXISTS `ChallongeParticipent`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeParticipent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`ChallongeTournamentId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Name` varchar(500) NOT NULL DEFAULT '0',
|
|
||||||
`Rank` int(11) DEFAULT 0,
|
|
||||||
`IsMember` bit(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ChallongeTournament
|
|
||||||
DROP TABLE IF EXISTS `ChallongeTournament`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeTournament` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Name` varchar(500) DEFAULT NULL,
|
|
||||||
`GameId` int(11) DEFAULT NULL,
|
|
||||||
`Url` varchar(255) DEFAULT NULL,
|
|
||||||
`Sync` datetime NOT NULL DEFAULT current_timestamp(),
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `ChallongeTournament_GameIdPK` (`GameId`),
|
|
||||||
CONSTRAINT `ChallongeTournament_GameIdPK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Event
|
|
||||||
DROP TABLE IF EXISTS `Event`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Event` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(255) NOT NULL,
|
|
||||||
`Date` datetime NOT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`SmashSlug` varchar(255) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Game
|
|
||||||
DROP TABLE IF EXISTS `Game`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Game` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL,
|
|
||||||
`ImgUrl` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL,
|
|
||||||
`WordPressTag` varchar(255) DEFAULT NULL,
|
|
||||||
`WordPressTagOs` varchar(255) DEFAULT NULL,
|
|
||||||
`Order` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`LongName` varchar(255) DEFAULT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for procedure ladoseapi.ImportEvent
|
|
||||||
DROP PROCEDURE IF EXISTS `ImportEvent`;
|
|
||||||
DELIMITER //
|
|
||||||
CREATE DEFINER=`ladoseapi`@`%` PROCEDURE `ImportEvent`()
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO WPEvent (Id, Name,Slug,Date )
|
|
||||||
select event_id, event_name,event_slug, event_start_date from ladose.wp_em_events
|
|
||||||
where event_id not in (select Id from WPEvent);
|
|
||||||
|
|
||||||
INSERT INTO WPUser (Id, Name, WPUSerLogin, WPMail)
|
|
||||||
select ID, display_name, user_login , user_email from ladose.wp_users
|
|
||||||
where ID not in (select Id from WPUser);
|
|
||||||
|
|
||||||
DELETE a from WPBooking a
|
|
||||||
INNER JOIN ladose.wp_em_bookings b ON b.event_id = a.WPEventId AND b.person_id = a.WPUserId
|
|
||||||
WHERE b.booking_status = 3;
|
|
||||||
|
|
||||||
INSERT INTO WPBooking (WPEventId, WPUserId, Message, Meta)
|
|
||||||
select event_id, person_id, booking_comment , booking_meta from ladose.wp_em_bookings b
|
|
||||||
where (event_id , person_id) not in (select WPEventId,WPUserId from WPBooking) and b.booking_status = 1;
|
|
||||||
-- Supression des joueurs qui ont un event annulé.
|
|
||||||
|
|
||||||
-- Maj des nom d'utilisateur
|
|
||||||
-- UPDATE WPUser a
|
|
||||||
-- INNER JOIN ladose.wp_users b ON a.Id = b.ID
|
|
||||||
-- SET a.Name = b.display_name
|
|
||||||
-- WHERE b.display_name != a.Name;
|
|
||||||
END//
|
|
||||||
DELIMITER ;
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Player
|
|
||||||
DROP TABLE IF EXISTS `Player`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Player` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`Gamertag` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
KEY `Id` (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=151 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Result
|
|
||||||
DROP TABLE IF EXISTS `Result`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Result` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`PlayerId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`TournamentId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Point` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Rank` int(11) NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=546 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Set
|
|
||||||
DROP TABLE IF EXISTS `Set`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Set` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`TournamentId` int(11) NOT NULL,
|
|
||||||
`Player1Id` int(11) NOT NULL,
|
|
||||||
`Player2Id` int(11) NOT NULL,
|
|
||||||
`Player1Score` int(11) DEFAULT NULL,
|
|
||||||
`Player2Score` int(11) DEFAULT NULL,
|
|
||||||
`Round` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=551 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.SmashParticipent
|
|
||||||
DROP TABLE IF EXISTS `SmashParticipent`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `SmashParticipent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`Tag` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`SmashId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Todo
|
|
||||||
DROP TABLE IF EXISTS `Todo`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Todo` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`User` varchar(45) NOT NULL,
|
|
||||||
`Task` mediumtext DEFAULT NULL,
|
|
||||||
`Done` tinyint(4) NOT NULL DEFAULT 0,
|
|
||||||
`Created` datetime NOT NULL,
|
|
||||||
`Deleted` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Tournament
|
|
||||||
DROP TABLE IF EXISTS `Tournament`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `Tournament` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`EventId` int(11) DEFAULT NULL,
|
|
||||||
`GameId` int(11) DEFAULT NULL,
|
|
||||||
`Finish` bit(1) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `UNIQ_SmashId` (`SmashId`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPBooking
|
|
||||||
DROP TABLE IF EXISTS `WPBooking`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPBooking` (
|
|
||||||
`WPEventId` int(11) DEFAULT NULL,
|
|
||||||
`WPUserId` int(11) DEFAULT NULL,
|
|
||||||
`Message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`Meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPEvent
|
|
||||||
DROP TABLE IF EXISTS `WPEvent`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPEvent` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(255) DEFAULT NULL,
|
|
||||||
`Slug` varchar(255) DEFAULT NULL,
|
|
||||||
`Date` date DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPUser
|
|
||||||
DROP TABLE IF EXISTS `WPUser`;
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPUser` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`WPUserLogin` varchar(45) DEFAULT NULL,
|
|
||||||
`WPMail` varchar(45) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
@@ -1,271 +0,0 @@
|
|||||||
-- --------------------------------------------------------
|
|
||||||
-- Host: 192.168.20.36
|
|
||||||
-- Server version: 10.7.3-MariaDB - Arch Linux
|
|
||||||
-- Server OS: Linux
|
|
||||||
-- HeidiSQL Version: 10.2.0.5599
|
|
||||||
-- --------------------------------------------------------
|
|
||||||
|
|
||||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
|
||||||
/*!40101 SET NAMES utf8 */;
|
|
||||||
/*!50503 SET NAMES utf8mb4 */;
|
|
||||||
/*!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' */;
|
|
||||||
|
|
||||||
|
|
||||||
-- Dumping database structure for ladoseapi
|
|
||||||
CREATE DATABASE IF NOT EXISTS `ladoseapi` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
|
|
||||||
USE `ladoseapi`;
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationRole
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationRole` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(50) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationUser
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationUser` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`FirstName` varchar(45) DEFAULT NULL,
|
|
||||||
`LastName` varchar(45) DEFAULT NULL,
|
|
||||||
`UserName` varchar(45) DEFAULT NULL,
|
|
||||||
`PasswordHash` blob DEFAULT NULL,
|
|
||||||
`PasswordSalt` blob DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ApplicationUserRole
|
|
||||||
CREATE TABLE IF NOT EXISTS `ApplicationUserRole` (
|
|
||||||
`UserId` int(11) NOT NULL,
|
|
||||||
`RoleId` int(11) NOT NULL,
|
|
||||||
UNIQUE KEY `UserId_RoleId` (`UserId`,`RoleId`),
|
|
||||||
KEY `FK_ApplicationUserRole_ApplicationRole` (`RoleId`),
|
|
||||||
CONSTRAINT `FK_ApplicationUserRole_ApplicationRole` FOREIGN KEY (`RoleId`) REFERENCES `ApplicationRole` (`Id`),
|
|
||||||
CONSTRAINT `FK_ApplicationUserRole_ApplicationUser` FOREIGN KEY (`UserId`) REFERENCES `ApplicationUser` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.BotEvent
|
|
||||||
CREATE TABLE IF NOT EXISTS `BotEvent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`Date` date NOT NULL DEFAULT current_timestamp(),
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.BotEventResult
|
|
||||||
CREATE TABLE IF NOT EXISTS `BotEventResult` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`BotEventId` int(11) NOT NULL,
|
|
||||||
`Name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`DiscordId` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`Result` bit(1) NOT NULL DEFAULT b'0',
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `FK_BotEvent_BotEvent` (`BotEventId`),
|
|
||||||
CONSTRAINT `FK_BotEvent_BotEvent` FOREIGN KEY (`BotEventId`) REFERENCES `BotEvent` (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ChallongeParticipent
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeParticipent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`ChallongeTournamentId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Name` varchar(500) NOT NULL DEFAULT '0',
|
|
||||||
`Rank` int(11) DEFAULT 0,
|
|
||||||
`IsMember` bit(1) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.ChallongeTournament
|
|
||||||
CREATE TABLE IF NOT EXISTS `ChallongeTournament` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`ChallongeId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Name` varchar(500) DEFAULT NULL,
|
|
||||||
`GameId` int(11) DEFAULT NULL,
|
|
||||||
`Url` varchar(255) DEFAULT NULL,
|
|
||||||
`Sync` datetime NOT NULL DEFAULT current_timestamp(),
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
KEY `ChallongeTournament_GameIdPK` (`GameId`),
|
|
||||||
CONSTRAINT `ChallongeTournament_GameIdPK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Event
|
|
||||||
CREATE TABLE IF NOT EXISTS `Event` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(255) NOT NULL,
|
|
||||||
`Date` datetime NOT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`SmashSlug` varchar(255) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Game
|
|
||||||
CREATE TABLE IF NOT EXISTS `Game` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(45) CHARACTER SET utf8mb3 DEFAULT NULL,
|
|
||||||
`ImgUrl` varchar(255) CHARACTER SET utf8mb3 DEFAULT NULL,
|
|
||||||
`WordPressTag` varchar(255) DEFAULT NULL,
|
|
||||||
`WordPressTagOs` varchar(255) DEFAULT NULL,
|
|
||||||
`Order` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`LongName` varchar(255) DEFAULT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `name_UNIQUE` (`Name`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for procedure ladoseapi.ImportEvent
|
|
||||||
DELIMITER //
|
|
||||||
CREATE DEFINER=`ladoseapi`@`%` PROCEDURE `ImportEvent`()
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO WPEvent (Id, Name,Slug,Date )
|
|
||||||
select event_id, event_name,event_slug, event_start_date from ladose.wp_em_events
|
|
||||||
where event_id not in (select Id from WPEvent);
|
|
||||||
|
|
||||||
INSERT INTO WPUser (Id, Name, WPUSerLogin, WPMail)
|
|
||||||
select ID, display_name, user_login , user_email from ladose.wp_users
|
|
||||||
where ID not in (select Id from WPUser);
|
|
||||||
|
|
||||||
DELETE a from WPBooking a
|
|
||||||
INNER JOIN ladose.wp_em_bookings b ON b.event_id = a.WPEventId AND b.person_id = a.WPUserId
|
|
||||||
WHERE b.booking_status = 3;
|
|
||||||
|
|
||||||
INSERT INTO WPBooking (WPEventId, WPUserId, Message, Meta)
|
|
||||||
select event_id, person_id, booking_comment , booking_meta from ladose.wp_em_bookings b
|
|
||||||
where (event_id , person_id) not in (select WPEventId,WPUserId from WPBooking) and b.booking_status = 1;
|
|
||||||
-- Supression des joueurs qui ont un event annulé.
|
|
||||||
|
|
||||||
-- Maj des nom d'utilisateur
|
|
||||||
-- UPDATE WPUser a
|
|
||||||
-- INNER JOIN ladose.wp_users b ON a.Id = b.ID
|
|
||||||
-- SET a.Name = b.display_name
|
|
||||||
-- WHERE b.display_name != a.Name;
|
|
||||||
END//
|
|
||||||
DELIMITER ;
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Player
|
|
||||||
CREATE TABLE IF NOT EXISTS `Player` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`Gamertag` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
KEY `Id` (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=176 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Result
|
|
||||||
CREATE TABLE IF NOT EXISTS `Result` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`PlayerId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`TournamentId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Point` int(11) NOT NULL DEFAULT 0,
|
|
||||||
`Rank` int(11) NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=1207 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Set
|
|
||||||
CREATE TABLE IF NOT EXISTS `Set` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`TournamentId` int(11) NOT NULL,
|
|
||||||
`Player1Id` int(11) NOT NULL,
|
|
||||||
`Player2Id` int(11) NOT NULL,
|
|
||||||
`Player1Score` int(11) DEFAULT NULL,
|
|
||||||
`Player2Score` int(11) DEFAULT NULL,
|
|
||||||
`Round` int(11) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=1870 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.SmashParticipent
|
|
||||||
CREATE TABLE IF NOT EXISTS `SmashParticipent` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`Tag` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`SmashId` int(11) NOT NULL DEFAULT 0,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Todo
|
|
||||||
CREATE TABLE IF NOT EXISTS `Todo` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`User` varchar(45) NOT NULL,
|
|
||||||
`Task` mediumtext DEFAULT NULL,
|
|
||||||
`Done` tinyint(4) NOT NULL DEFAULT 0,
|
|
||||||
`Created` datetime NOT NULL,
|
|
||||||
`Deleted` datetime DEFAULT NULL,
|
|
||||||
PRIMARY KEY (`Id`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.Tournament
|
|
||||||
CREATE TABLE IF NOT EXISTS `Tournament` (
|
|
||||||
`Id` int(11) NOT NULL AUTO_INCREMENT,
|
|
||||||
`Name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
|
||||||
`SmashId` int(11) DEFAULT NULL,
|
|
||||||
`ChallongeId` int(11) DEFAULT NULL,
|
|
||||||
`EventId` int(11) DEFAULT NULL,
|
|
||||||
`GameId` int(11) DEFAULT NULL,
|
|
||||||
`Finish` bit(1) NOT NULL,
|
|
||||||
PRIMARY KEY (`Id`),
|
|
||||||
UNIQUE KEY `UNIQ_SmashId` (`SmashId`)
|
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=87 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPBooking
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPBooking` (
|
|
||||||
`WPEventId` int(11) DEFAULT NULL,
|
|
||||||
`WPUserId` int(11) DEFAULT NULL,
|
|
||||||
`Message` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
|
||||||
`Meta` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPEvent
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPEvent` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(255) DEFAULT NULL,
|
|
||||||
`Slug` varchar(255) DEFAULT NULL,
|
|
||||||
`Date` date DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
-- Dumping structure for table ladoseapi.WPUser
|
|
||||||
CREATE TABLE IF NOT EXISTS `WPUser` (
|
|
||||||
`Id` int(11) NOT NULL,
|
|
||||||
`Name` varchar(45) DEFAULT NULL,
|
|
||||||
`WPUserLogin` varchar(45) DEFAULT NULL,
|
|
||||||
`WPMail` varchar(45) DEFAULT NULL
|
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
|
|
||||||
|
|
||||||
-- Data exporting was unselected.
|
|
||||||
|
|
||||||
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
|
|
||||||
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
|
|
||||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
|
||||||
831
Sql/dump_20240316.sql
Normal file
831
Sql/dump_20240316.sql
Normal file
@@ -0,0 +1,831 @@
|
|||||||
|
--
|
||||||
|
-- PostgreSQL database dump
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Dumped from database version 16.1
|
||||||
|
-- Dumped by pg_dump version 16.2
|
||||||
|
|
||||||
|
SET statement_timeout = 0;
|
||||||
|
SET lock_timeout = 0;
|
||||||
|
SET idle_in_transaction_session_timeout = 0;
|
||||||
|
SET client_encoding = 'UTF8';
|
||||||
|
SET standard_conforming_strings = on;
|
||||||
|
SELECT pg_catalog.set_config('search_path', '', false);
|
||||||
|
SET check_function_bodies = false;
|
||||||
|
SET xmloption = content;
|
||||||
|
SET client_min_messages = warning;
|
||||||
|
SET row_security = off;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: ladoseapi; Type: SCHEMA; Schema: -; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SCHEMA ladoseapi;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SCHEMA ladoseapi OWNER TO tom;
|
||||||
|
|
||||||
|
SET default_tablespace = '';
|
||||||
|
|
||||||
|
SET default_table_access_method = heap;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationrole; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.applicationrole (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(50) NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.applicationrole OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationrole_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.applicationrole_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.applicationrole_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationrole_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.applicationrole_id_seq OWNED BY ladoseapi.applicationrole.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuser; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.applicationuser (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
firstname character varying(45) DEFAULT NULL::character varying,
|
||||||
|
lastname character varying(45) DEFAULT NULL::character varying,
|
||||||
|
username character varying(45) DEFAULT NULL::character varying,
|
||||||
|
passwordhash bytea,
|
||||||
|
passwordsalt bytea
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.applicationuser OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuser_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.applicationuser_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.applicationuser_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuser_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.applicationuser_id_seq OWNED BY ladoseapi.applicationuser.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuserrole; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.applicationuserrole (
|
||||||
|
userid bigint NOT NULL,
|
||||||
|
roleid bigint NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.applicationuserrole OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: botevent; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.botevent (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(50) NOT NULL,
|
||||||
|
date date DEFAULT CURRENT_TIMESTAMP NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.botevent OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: botevent_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.botevent_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.botevent_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: botevent_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.botevent_id_seq OWNED BY ladoseapi.botevent.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.boteventresult (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
boteventid bigint NOT NULL,
|
||||||
|
name character varying(50) NOT NULL,
|
||||||
|
discordid character varying(50) NOT NULL,
|
||||||
|
result boolean NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.boteventresult OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.boteventresult_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.boteventresult_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.boteventresult_id_seq OWNED BY ladoseapi.boteventresult.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongeparticipent; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.challongeparticipent (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
challongeid bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
challongetournamentid bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
name character varying(500) DEFAULT '0'::character varying NOT NULL,
|
||||||
|
rank bigint DEFAULT '0'::bigint,
|
||||||
|
ismember boolean
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.challongeparticipent OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongeparticipent_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.challongeparticipent_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.challongeparticipent_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongeparticipent_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.challongeparticipent_id_seq OWNED BY ladoseapi.challongeparticipent.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.challongetournament (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
challongeid bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
name character varying(500) DEFAULT NULL::character varying,
|
||||||
|
gameid bigint,
|
||||||
|
url character varying(255) DEFAULT NULL::character varying,
|
||||||
|
sync timestamp with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.challongetournament OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.challongetournament_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.challongetournament_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.challongetournament_id_seq OWNED BY ladoseapi.challongetournament.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: event; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.event (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(255) NOT NULL,
|
||||||
|
date timestamp with time zone NOT NULL,
|
||||||
|
smashid bigint,
|
||||||
|
smashslug character varying(255) DEFAULT NULL::character varying
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.event OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: event_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.event_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.event_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: event_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.event_id_seq OWNED BY ladoseapi.event.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: game; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.game (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(45) DEFAULT NULL::character varying,
|
||||||
|
imgurl character varying(255) DEFAULT NULL::character varying,
|
||||||
|
wordpresstag character varying(255) DEFAULT NULL::character varying,
|
||||||
|
wordpresstagos character varying(255) DEFAULT NULL::character varying,
|
||||||
|
"order" bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
longname character varying(255) DEFAULT NULL::character varying,
|
||||||
|
smashid bigint
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.game OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: game_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.game_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.game_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: game_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.game_id_seq OWNED BY ladoseapi.game.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: player; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.player (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(150) NOT NULL,
|
||||||
|
challongeid bigint,
|
||||||
|
smashid bigint,
|
||||||
|
gamertag character varying(150) DEFAULT NULL::character varying
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.player OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: player_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.player_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.player_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: player_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.player_id_seq OWNED BY ladoseapi.player.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: result; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.result (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
playerid bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
tournamentid bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
point bigint DEFAULT '0'::bigint NOT NULL,
|
||||||
|
rank bigint DEFAULT '0'::bigint NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.result OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: result_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.result_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.result_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: result_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.result_id_seq OWNED BY ladoseapi.result.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: set; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.set (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
tournamentid bigint NOT NULL,
|
||||||
|
player1id bigint NOT NULL,
|
||||||
|
player2id bigint NOT NULL,
|
||||||
|
player1score bigint,
|
||||||
|
player2score bigint,
|
||||||
|
round bigint NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.set OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: set_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.set_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.set_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: set_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.set_id_seq OWNED BY ladoseapi.set.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: todo; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.todo (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
"user" character varying(45) NOT NULL,
|
||||||
|
task text,
|
||||||
|
done smallint DEFAULT '0'::smallint NOT NULL,
|
||||||
|
created timestamp with time zone NOT NULL,
|
||||||
|
deleted timestamp with time zone
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.todo OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: todo_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.todo_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.todo_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: todo_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.todo_id_seq OWNED BY ladoseapi.todo.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: tournament; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.tournament (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(150) NOT NULL,
|
||||||
|
smashid bigint,
|
||||||
|
challongeid bigint,
|
||||||
|
eventid bigint,
|
||||||
|
gameid bigint,
|
||||||
|
finish boolean NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.tournament OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: tournament_id_seq; Type: SEQUENCE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE SEQUENCE ladoseapi.tournament_id_seq
|
||||||
|
START WITH 1
|
||||||
|
INCREMENT BY 1
|
||||||
|
NO MINVALUE
|
||||||
|
NO MAXVALUE
|
||||||
|
CACHE 1;
|
||||||
|
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.tournament_id_seq OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: tournament_id_seq; Type: SEQUENCE OWNED BY; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER SEQUENCE ladoseapi.tournament_id_seq OWNED BY ladoseapi.tournament.id;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: wpbooking; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.wpbooking (
|
||||||
|
wpeventid bigint,
|
||||||
|
wpuserid bigint,
|
||||||
|
message text,
|
||||||
|
meta text
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.wpbooking OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: wpevent; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.wpevent (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(255) DEFAULT NULL::character varying,
|
||||||
|
slug character varying(255) DEFAULT NULL::character varying,
|
||||||
|
date date
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.wpevent OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: wpuser; Type: TABLE; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE ladoseapi.wpuser (
|
||||||
|
id bigint NOT NULL,
|
||||||
|
name character varying(45) DEFAULT NULL::character varying,
|
||||||
|
wpuserlogin character varying(45) DEFAULT NULL::character varying,
|
||||||
|
wpmail character varying(45) DEFAULT NULL::character varying
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE ladoseapi.wpuser OWNER TO tom;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationrole id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationrole ALTER COLUMN id SET DEFAULT nextval('ladoseapi.applicationrole_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuser id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationuser ALTER COLUMN id SET DEFAULT nextval('ladoseapi.applicationuser_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: botevent id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.botevent ALTER COLUMN id SET DEFAULT nextval('ladoseapi.botevent_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.boteventresult ALTER COLUMN id SET DEFAULT nextval('ladoseapi.boteventresult_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongeparticipent id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.challongeparticipent ALTER COLUMN id SET DEFAULT nextval('ladoseapi.challongeparticipent_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.challongetournament ALTER COLUMN id SET DEFAULT nextval('ladoseapi.challongetournament_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: event id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.event ALTER COLUMN id SET DEFAULT nextval('ladoseapi.event_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: game id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.game ALTER COLUMN id SET DEFAULT nextval('ladoseapi.game_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: player id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.player ALTER COLUMN id SET DEFAULT nextval('ladoseapi.player_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: result id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.result ALTER COLUMN id SET DEFAULT nextval('ladoseapi.result_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: set id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.set ALTER COLUMN id SET DEFAULT nextval('ladoseapi.set_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: todo id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.todo ALTER COLUMN id SET DEFAULT nextval('ladoseapi.todo_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: tournament id; Type: DEFAULT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.tournament ALTER COLUMN id SET DEFAULT nextval('ladoseapi.tournament_id_seq'::regclass);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationrole idx_17720_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationrole
|
||||||
|
ADD CONSTRAINT idx_17720_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuser idx_17725_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationuser
|
||||||
|
ADD CONSTRAINT idx_17725_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: botevent idx_17738_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.botevent
|
||||||
|
ADD CONSTRAINT idx_17738_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult idx_17744_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.boteventresult
|
||||||
|
ADD CONSTRAINT idx_17744_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongeparticipent idx_17749_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.challongeparticipent
|
||||||
|
ADD CONSTRAINT idx_17749_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament idx_17760_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.challongetournament
|
||||||
|
ADD CONSTRAINT idx_17760_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: event idx_17771_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.event
|
||||||
|
ADD CONSTRAINT idx_17771_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: game idx_17779_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.game
|
||||||
|
ADD CONSTRAINT idx_17779_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: result idx_17798_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.result
|
||||||
|
ADD CONSTRAINT idx_17798_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: set idx_17807_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.set
|
||||||
|
ADD CONSTRAINT idx_17807_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: todo idx_17812_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.todo
|
||||||
|
ADD CONSTRAINT idx_17812_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: tournament idx_17820_primary; Type: CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.tournament
|
||||||
|
ADD CONSTRAINT idx_17820_primary PRIMARY KEY (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17734_fk_applicationuserrole_applicationrole; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX idx_17734_fk_applicationuserrole_applicationrole ON ladoseapi.applicationuserrole USING btree (roleid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17734_userid_roleid; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX idx_17734_userid_roleid ON ladoseapi.applicationuserrole USING btree (userid, roleid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17744_fk_botevent_botevent; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX idx_17744_fk_botevent_botevent ON ladoseapi.boteventresult USING btree (boteventid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17760_challongetournament_gameidpk; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX idx_17760_challongetournament_gameidpk ON ladoseapi.challongetournament USING btree (gameid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17779_name_unique; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX idx_17779_name_unique ON ladoseapi.game USING btree (name);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17792_id; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE INDEX idx_17792_id ON ladoseapi.player USING btree (id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: idx_17820_uniq_smashid; Type: INDEX; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE UNIQUE INDEX idx_17820_uniq_smashid ON ladoseapi.tournament USING btree (smashid);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: challongetournament challongetournament_gameidpk; Type: FK CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.challongetournament
|
||||||
|
ADD CONSTRAINT challongetournament_gameidpk FOREIGN KEY (gameid) REFERENCES ladoseapi.game(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuserrole fk_applicationuserrole_applicationrole; Type: FK CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationuserrole
|
||||||
|
ADD CONSTRAINT fk_applicationuserrole_applicationrole FOREIGN KEY (roleid) REFERENCES ladoseapi.applicationrole(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: applicationuserrole fk_applicationuserrole_applicationuser; Type: FK CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.applicationuserrole
|
||||||
|
ADD CONSTRAINT fk_applicationuserrole_applicationuser FOREIGN KEY (userid) REFERENCES ladoseapi.applicationuser(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: boteventresult fk_botevent_botevent; Type: FK CONSTRAINT; Schema: ladoseapi; Owner: tom
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY ladoseapi.boteventresult
|
||||||
|
ADD CONSTRAINT fk_botevent_botevent FOREIGN KEY (boteventid) REFERENCES ladoseapi.botevent(id) ON UPDATE RESTRICT ON DELETE RESTRICT;
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- PostgreSQL database dump complete
|
||||||
|
--
|
||||||
|
|
||||||
Reference in New Issue
Block a user