From 39075051b2fea4c3894cd0b7fa97debd92b02847 Mon Sep 17 00:00:00 2001 From: Darkstack <1835601+darkstack@users.noreply.github.com> Date: Mon, 8 Oct 2018 23:33:18 +0200 Subject: [PATCH] Creation des Challonges a partir des Event WordPress --- .../LaDOSE.Api/Controllers/EventController.cs | 6 +- .../LaDOSE.Entity/Context/LaDOSEDbContext.cs | 42 ++- .../LaDOSE.Entity/Wordpress/WPBooking.cs | 16 ++ LaDOSE.Src/LaDOSE.Entity/Wordpress/WPEvent.cs | 17 ++ LaDOSE.Src/LaDOSE.Entity/Wordpress/WPUser.cs | 15 ++ .../Interface/IChallongeProvider.cs | 1 + .../LaDOSE.Service/Interface/IEventService.cs | 2 +- .../Provider/ChallongeProvider.cs | 9 + .../LaDOSE.Service/Service/EventService.cs | 21 +- Sql/configure.sql | 249 ++++++++++-------- 10 files changed, 264 insertions(+), 114 deletions(-) create mode 100644 LaDOSE.Src/LaDOSE.Entity/Wordpress/WPBooking.cs create mode 100644 LaDOSE.Src/LaDOSE.Entity/Wordpress/WPEvent.cs create mode 100644 LaDOSE.Src/LaDOSE.Entity/Wordpress/WPUser.cs diff --git a/LaDOSE.Src/LaDOSE.Api/Controllers/EventController.cs b/LaDOSE.Src/LaDOSE.Api/Controllers/EventController.cs index 2c7dd4a..be79699 100644 --- a/LaDOSE.Src/LaDOSE.Api/Controllers/EventController.cs +++ b/LaDOSE.Src/LaDOSE.Api/Controllers/EventController.cs @@ -33,10 +33,10 @@ namespace LaDOSE.Api.Controllers } - [HttpGet("Generate/{dto}")] - public bool GenerateChallonge(int dto) + [HttpGet("Generate/{eventId}/{wpEventId}")] + public bool GenerateChallonge(int eventId, int wpEventId) { - return _eventService.CreateChallonge(dto); + return _eventService.CreateChallonge(eventId, wpEventId); } } diff --git a/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs b/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs index 950fa97..43aef00 100644 --- a/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs +++ b/LaDOSE.Src/LaDOSE.Entity/Context/LaDOSEDbContext.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore; +using LaDOSE.Entity.Wordpress; +using Microsoft.EntityFrameworkCore; namespace LaDOSE.Entity.Context { @@ -8,6 +9,14 @@ namespace LaDOSE.Entity.Context public DbSet ApplicationUser { get; set; } public DbSet Season { get; set; } public DbSet Event { get; set; } + + #region WordPress + public DbSet WPUser { get; set; } + public DbSet WPEvent { get; set; } + public DbSet WPBooking { get; set; } + + + #endregion public DbSet SeasonGame { get; set; } public DbSet EventGame { get; set; } @@ -20,17 +29,18 @@ namespace LaDOSE.Entity.Context base.OnModelCreating(modelBuilder); - modelBuilder.Entity() - .HasKey(t => new { t.SeasonId, t.GameId }); - modelBuilder.Entity() - .HasKey(t => new { t.EventId, t.GameId }); + + modelBuilder.Entity() .HasOne(s => s.Season) .WithMany(p => p.Event) .HasForeignKey(fk => fk.SeasonId); + #region SeasonGame + modelBuilder.Entity() + .HasKey(t => new { t.SeasonId, t.GameId }); modelBuilder.Entity() .HasOne(pt => pt.Season) @@ -41,7 +51,12 @@ namespace LaDOSE.Entity.Context .HasOne(pt => pt.Game) .WithMany(p => p.Seasons) .HasForeignKey(pt => pt.GameId); + #endregion + #region EventGame + + modelBuilder.Entity() + .HasKey(t => new { t.EventId, t.GameId }); modelBuilder.Entity() .HasOne(pt => pt.Event) @@ -52,6 +67,23 @@ namespace LaDOSE.Entity.Context .HasOne(pt => pt.Game) .WithMany(p => p.Events) .HasForeignKey(pt => pt.GameId); + #endregion + + #region WordPress WPBooking + + modelBuilder.Entity() + .HasKey(t => new { t.WPEventId, t.WPUserId }); + + modelBuilder.Entity() + .HasOne(pt => pt.WPEvent) + .WithMany(p => p.WPBookings) + .HasForeignKey(pt => pt.WPEventId); + + modelBuilder.Entity() + .HasOne(pt => pt.WPUser) + .WithMany(p => p.WPBookings) + .HasForeignKey(pt => pt.WPUserId); + #endregion } } diff --git a/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPBooking.cs b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPBooking.cs new file mode 100644 index 0000000..b1c2647 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPBooking.cs @@ -0,0 +1,16 @@ +namespace LaDOSE.Entity.Wordpress +{ + public class WPBooking + { + + //# WPEventId, WPUserId, Message, Meta + public int WPEventId { get; set; } + + public WPEvent WPEvent { get; set; } + public int WPUserId { get; set; } + public WPUser WPUser { get; set; } + public string Message { get; set; } + public string Meta { get; set; } + + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPEvent.cs b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPEvent.cs new file mode 100644 index 0000000..c1b96f0 --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPEvent.cs @@ -0,0 +1,17 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LaDOSE.Entity.Wordpress +{ + public class WPEvent + { + [Key] + // Id, Name, Slug, Date + public int Id { get; set; } + public string Name { get; set; } + public string Slug { get; set; } + public string Date { get; set; } + + public virtual IEnumerable WPBookings { get; set; } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPUser.cs b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPUser.cs new file mode 100644 index 0000000..151b45c --- /dev/null +++ b/LaDOSE.Src/LaDOSE.Entity/Wordpress/WPUser.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; + +namespace LaDOSE.Entity.Wordpress +{ + public class WPUser + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + public string WPUserId { get; set; } + public string WPMail { get; set; } + public virtual IEnumerable WPBookings { get; set; } + } +} \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/IChallongeProvider.cs b/LaDOSE.Src/LaDOSE.Service/Interface/IChallongeProvider.cs index f8e4558..d6803f4 100644 --- a/LaDOSE.Src/LaDOSE.Service/Interface/IChallongeProvider.cs +++ b/LaDOSE.Src/LaDOSE.Service/Interface/IChallongeProvider.cs @@ -9,5 +9,6 @@ namespace LaDOSE.Business.Interface Task GetLastTournament(); string GetLastTournamentMessage(); Task CreateTournament(string name, string url); + Task AddPlayer(int tournamentId, string userName); } } \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Service/Interface/IEventService.cs b/LaDOSE.Src/LaDOSE.Service/Interface/IEventService.cs index fa841e0..a78c099 100644 --- a/LaDOSE.Src/LaDOSE.Service/Interface/IEventService.cs +++ b/LaDOSE.Src/LaDOSE.Service/Interface/IEventService.cs @@ -4,6 +4,6 @@ namespace LaDOSE.Business.Interface { public interface IEventService : IBaseService { - bool CreateChallonge(int dto); + bool CreateChallonge(int eventId, int wpEventId); } } \ No newline at end of file diff --git a/LaDOSE.Src/LaDOSE.Service/Provider/ChallongeProvider.cs b/LaDOSE.Src/LaDOSE.Service/Provider/ChallongeProvider.cs index 1b84b4c..ca5e6b0 100644 --- a/LaDOSE.Src/LaDOSE.Service/Provider/ChallongeProvider.cs +++ b/LaDOSE.Src/LaDOSE.Service/Provider/ChallongeProvider.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Threading.Tasks; using ChallongeCSharpDriver; using ChallongeCSharpDriver.Caller; +using ChallongeCSharpDriver.Core.Objects; using ChallongeCSharpDriver.Core.Queries; using ChallongeCSharpDriver.Core.Results; using LaDOSE.Business.Interface; @@ -36,6 +37,14 @@ namespace LaDOSE.Business.Provider } + public async Task AddPlayer(int tournamentId, string userName) + { + var p = new ParticipantEntry(userName); + var result = await new AddParticipantQuery(tournamentId, p).call(ApiCaller); + return result; + + } + public async Task GetLastTournament() { try diff --git a/LaDOSE.Src/LaDOSE.Service/Service/EventService.cs b/LaDOSE.Src/LaDOSE.Service/Service/EventService.cs index 0022742..580d1e1 100644 --- a/LaDOSE.Src/LaDOSE.Service/Service/EventService.cs +++ b/LaDOSE.Src/LaDOSE.Service/Service/EventService.cs @@ -33,9 +33,13 @@ namespace LaDOSE.Business.Service return eventAdded.Entity; } - public bool CreateChallonge(int dto) + public bool CreateChallonge(int eventId,int wpEventId) { - var currentEvent = _context.Event.Include(e=>e.Games).ThenInclude(e=>e.Game).FirstOrDefault(e=>e.Id == dto); + var currentEvent = _context.Event.Include(e=>e.Games).ThenInclude(e=>e.Game).FirstOrDefault(e=>e.Id == eventId); + var currentWpEvent = _context.WPEvent.Include(e => e.WPBookings).ThenInclude(e => e.WPUser).Where(e=>e.Id == wpEventId); + var users = currentWpEvent.SelectMany(e => e.WPBookings.Select(u => u.WPUser)); + + var userNames = users.Select(e => e.Name).Distinct().ToList(); if (currentEvent != null) { var games = currentEvent.Games.Select(e => e.Game); @@ -48,6 +52,19 @@ namespace LaDOSE.Business.Service var eventGame = currentEvent.Games.FirstOrDefault(e => e.GameId == game.Id); eventGame.ChallongeId = tournament.id; eventGame.ChallongeUrl = tournament.url; + foreach (var userName in userNames) + { + try + { + _challongeProvider.AddPlayer(tournament.id, userName); + } + catch + { + Console.WriteLine($"Erreur d ajout sur {userName}" ); + continue; + + } + } _context.Entry(eventGame).State = EntityState.Modified; } diff --git a/Sql/configure.sql b/Sql/configure.sql index 76e3ad3..8b97ff0 100644 --- a/Sql/configure.sql +++ b/Sql/configure.sql @@ -1,169 +1,212 @@ --- phpMyAdmin SQL Dump --- version 4.6.4 --- https://www.phpmyadmin.net/ +-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64) -- --- Host: localhost --- Generation Time: Oct 06, 2018 at 10:12 PM --- Server version: 5.6.40-log --- PHP Version: 7.1.18 - -SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -SET time_zone = "+00:00"; - +-- Host: api.ladose.net 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 utf8mb4 */; - --- --- Database: `ladoseapi` --- - --- -------------------------------------------------------- +/*!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, + `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 -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- + `PasswordSalt` blob, + PRIMARY KEY (`Id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 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, + `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 -) ENGINE=InnoDB DEFAULT CHARSET=utf8; + `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, + `Id` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(45) CHARACTER SET utf8 DEFAULT NULL, - `ImgUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- -------------------------------------------------------- + `ImgUrl` varchar(255) CHARACTER SET utf8 DEFAULT NULL, + PRIMARY KEY (`Id`), + UNIQUE KEY `name_UNIQUE` (`Name`) +) ENGINE=InnoDB AUTO_INCREMENT=3 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, + `Id` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(45) DEFAULT NULL, `StartDate` datetime DEFAULT NULL, - `EndDate` datetime DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - --- -------------------------------------------------------- + `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 + `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 */; -- --- Indexes for dumped tables +-- Table structure for table `WPBooking` -- --- --- Indexes for table `ApplicationUser` --- -ALTER TABLE `ApplicationUser` - ADD PRIMARY KEY (`Id`); +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 */; -- --- Indexes for table `Event` --- -ALTER TABLE `Event` - ADD PRIMARY KEY (`Id`), - ADD KEY `SeasonPK_idx` (`SeasonId`); - --- --- Indexes for table `Game` --- -ALTER TABLE `Game` - ADD PRIMARY KEY (`Id`), - ADD UNIQUE KEY `name_UNIQUE` (`Name`); - --- --- Indexes for table `Season` --- -ALTER TABLE `Season` - ADD PRIMARY KEY (`Id`), - ADD UNIQUE KEY `Name_UNIQUE` (`Name`); - --- --- Indexes for table `SeasonGame` --- -ALTER TABLE `SeasonGame` - ADD PRIMARY KEY (`SeasonId`,`GameId`), - ADD KEY `GamePK_idx` (`GameId`); - --- --- AUTO_INCREMENT for dumped tables +-- Table structure for table `WPEvent` -- --- --- AUTO_INCREMENT for table `ApplicationUser` --- -ALTER TABLE `ApplicationUser` - MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; --- --- AUTO_INCREMENT for table `Event` --- -ALTER TABLE `Event` - MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; --- --- AUTO_INCREMENT for table `Game` --- -ALTER TABLE `Game` - MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; --- --- AUTO_INCREMENT for table `Season` --- -ALTER TABLE `Season` - MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; --- --- Constraints for dumped tables --- +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 */; -- --- Constraints for table `Event` +-- Table structure for table `WPUser` -- -ALTER TABLE `Event` - ADD CONSTRAINT `SeasonsPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION; + +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 */; -- --- Constraints for table `SeasonGame` +-- Dumping routines for database 'ladoseapi' -- -ALTER TABLE `SeasonGame` - ADD CONSTRAINT `GamePK` FOREIGN KEY (`GameId`) REFERENCES `Game` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION, - ADD CONSTRAINT `SeasonPK` FOREIGN KEY (`SeasonId`) REFERENCES `Season` (`Id`) ON DELETE NO ACTION ON UPDATE NO ACTION; +/*!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 2018-10-08 23:31:28 +i