Profiler/Completion

* split completion table into it's subcomponents
 * this should save some disk space as some keys and null fields have been optimized out and col sizes have been reduced
 * sort ICC raid bosses first to last
This commit is contained in:
Sarjuuk
2024-07-08 20:14:01 +02:00
parent 98b1771850
commit 460615c112
7 changed files with 307 additions and 147 deletions

View File

@@ -1820,24 +1820,118 @@ CREATE TABLE `aowow_profiler_arena_team_member` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_achievements`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_achievements`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_achievements` (
`id` int(10) unsigned NOT NULL,
`achievementId` smallint(5) unsigned NOT NULL,
`date` int(10) unsigned DEFAULT NULL,
KEY `id` (`id`),
KEY `typeId` (`achievementId`),
CONSTRAINT `FK_pr_completion_achievements` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_quests`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_quests`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_quests` (
`id` int(10) unsigned NOT NULL,
`questId` mediumint(8) unsigned NOT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_quests` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_reputation`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_reputation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_reputation` (
`id` int(10) unsigned NOT NULL,
`factionId` smallint(5) unsigned NOT NULL,
`standing` mediumint(9) DEFAULT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_reputation` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_skills`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_skills`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_skills` (
`id` int(10) unsigned NOT NULL,
`skillId` smallint(5) unsigned NOT NULL,
`value` smallint(5) unsigned DEFAULT NULL,
`max` smallint(5) unsigned DEFAULT NULL,
KEY `id` (`id`),
KEY `typeId` (`skillId`),
CONSTRAINT `FK_pr_completion_skills` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_spells`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_spells`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_spells` (
`id` int(10) unsigned NOT NULL,
`spellId` mediumint(8) unsigned NOT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_spells` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion_statistics`
--
DROP TABLE IF EXISTS `aowow_profiler_completion_statistics`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion_statistics` (
`id` int(10) unsigned NOT NULL,
`achievementId` smallint(6) NOT NULL,
`date` int(10) unsigned DEFAULT NULL,
`counter` smallint(5) unsigned DEFAULT NULL,
KEY `id` (`id`),
KEY `typeId` (`achievementId`),
CONSTRAINT `FK_pr_completion_statistics` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `aowow_profiler_completion`
--
DROP TABLE IF EXISTS `aowow_profiler_completion`;
DROP TABLE IF EXISTS `aowow_profiler_completion_titles`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `aowow_profiler_completion` (
`id` int unsigned NOT NULL,
`type` smallint unsigned NOT NULL,
`typeId` mediumint NOT NULL,
`cur` int DEFAULT NULL,
`max` int DEFAULT NULL,
CREATE TABLE `aowow_profiler_completion_titles` (
`id` int(10) unsigned NOT NULL,
`titleId` tinyint(3) unsigned NOT NULL,
KEY `id` (`id`),
KEY `type` (`type`),
KEY `typeId` (`typeId`),
CONSTRAINT `FK_pr_completion` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CONSTRAINT `FK_pr_completion_titles` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
/*!40101 SET character_set_client = @saved_cs_client */;
--
@@ -3226,7 +3320,7 @@ UNLOCK TABLES;
LOCK TABLES `aowow_dbversion` WRITE;
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
INSERT INTO `aowow_dbversion` VALUES (1720451579,0,NULL,NULL);
INSERT INTO `aowow_dbversion` VALUES (1720455279,0,NULL,NULL);
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
UNLOCK TABLES;

View File

@@ -0,0 +1,73 @@
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `aowow_profiler_completion_quests`;
CREATE TABLE `aowow_profiler_completion_quests` (
`id` int unsigned NOT NULL,
`questId` mediumint unsigned NOT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_quests` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_skills`;
CREATE TABLE `aowow_profiler_completion_skills` (
`id` int unsigned NOT NULL,
`skillId` smallint unsigned NOT NULL,
`value` smallint unsigned DEFAULT NULL,
`max` smallint unsigned DEFAULT NULL,
KEY `id` (`id`),
KEY `typeId` (`skillId`),
CONSTRAINT `FK_pr_completion_skills` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_reputation`;
CREATE TABLE `aowow_profiler_completion_reputation` (
`id` int unsigned NOT NULL,
`factionId` smallint unsigned NOT NULL,
`standing` mediumint DEFAULT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_reputation` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_titles`;
CREATE TABLE `aowow_profiler_completion_titles` (
`id` int unsigned NOT NULL,
`titleId` tinyint unsigned NOT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_titles` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_achievements`;
CREATE TABLE `aowow_profiler_completion_achievements` (
`id` int unsigned NOT NULL,
`achievementId` smallint unsigned NOT NULL,
`date` int unsigned DEFAULT NULL,
KEY `id` (`id`),
KEY `typeId` (`achievementId`),
CONSTRAINT `FK_pr_completion_achievements` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_statistics`;
CREATE TABLE `aowow_profiler_completion_statistics` (
`id` int unsigned NOT NULL,
`achievementId` smallint NOT NULL,
`date` int unsigned DEFAULT NULL,
`counter` smallint unsigned DEFAULT NULL, -- could be values of INT size, but surely not for bosskill counters, right? ... RIGHT!?
KEY `id` (`id`),
KEY `typeId` (`achievementId`),
CONSTRAINT `FK_pr_completion_statistics` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
DROP TABLE IF EXISTS `aowow_profiler_completion_spells`;
CREATE TABLE `aowow_profiler_completion_spells` (
`id` int unsigned NOT NULL,
`spellId` mediumint unsigned NOT NULL,
KEY `id` (`id`),
CONSTRAINT `FK_pr_completion_spells` FOREIGN KEY (`id`) REFERENCES `aowow_profiler_profiles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- force profiles to be updated
UPDATE `aowow_profiler_profiles` SET `lastUpdated` = 0;
DROP TABLE IF EXISTS `aowow_profiler_completion`;
SET FOREIGN_KEY_CHECKS=1;