mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Arenas: Refactor arena code and db layout
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
-- MySQL dump 10.13 Distrib 5.1.51, for pc-linux-gnu (i686)
|
||||
-- MySQL dump 10.13 Distrib 5.5.9, for Win64 (x86)
|
||||
--
|
||||
-- Host: localhost Database: characters
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 5.1.51-log
|
||||
-- Server version 5.5.9
|
||||
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||
@@ -63,7 +63,6 @@ LOCK TABLES `account_instance_times` WRITE;
|
||||
/*!40000 ALTER TABLE `account_instance_times` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `account_instance_times` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
|
||||
|
||||
--
|
||||
-- Table structure for table `account_tutorial`
|
||||
@@ -126,16 +125,22 @@ DROP TABLE IF EXISTS `arena_team`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `arena_team` (
|
||||
`arenateamid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`arenaTeamId` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`name` varchar(24) NOT NULL,
|
||||
`captainguid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`captainGuid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BackgroundColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`EmblemStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`EmblemColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`BorderStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`BorderColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`arenateamid`)
|
||||
`rating` smallint(5) unsigned NOT NULL,
|
||||
`seasonGames` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`seasonWins` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`weekGames` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`weekWins` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`rank` int(10) unsigned NOT NULL,
|
||||
`backgroundColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`emblemStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`emblemColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`borderStyle` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`borderColor` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`arenaTeamId`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
@@ -158,10 +163,11 @@ DROP TABLE IF EXISTS `arena_team_member`;
|
||||
CREATE TABLE `arena_team_member` (
|
||||
`arenateamid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`guid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`played_week` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`wons_week` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`played_season` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`wons_season` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`weekGames` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`weekWins` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`seasonGames` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`seasonWins` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
`personalRating` smallint(5) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`arenateamid`,`guid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -175,34 +181,6 @@ LOCK TABLES `arena_team_member` WRITE;
|
||||
/*!40000 ALTER TABLE `arena_team_member` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `arena_team_stats`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `arena_team_stats`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `arena_team_stats` (
|
||||
`arenateamid` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`rating` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`games` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`wins` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`played` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`wins2` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`rank` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`arenateamid`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Dumping data for table `arena_team_stats`
|
||||
--
|
||||
|
||||
LOCK TABLES `arena_team_stats` WRITE;
|
||||
/*!40000 ALTER TABLE `arena_team_stats` DISABLE KEYS */;
|
||||
/*!40000 ALTER TABLE `arena_team_stats` ENABLE KEYS */;
|
||||
UNLOCK TABLES;
|
||||
|
||||
--
|
||||
-- Table structure for table `auctionhouse`
|
||||
--
|
||||
@@ -397,8 +375,8 @@ DROP TABLE IF EXISTS `character_arena_stats`;
|
||||
CREATE TABLE `character_arena_stats` (
|
||||
`guid` int(10) NOT NULL,
|
||||
`slot` tinyint(3) NOT NULL,
|
||||
`personal_rating` int(10) NOT NULL,
|
||||
`matchmaker_rating` int(10) NOT NULL,
|
||||
`personalRating` smallint(5) NOT NULL,
|
||||
`matchMakerRating` smallint(5) NOT NULL,
|
||||
PRIMARY KEY (`guid`,`slot`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
@@ -2219,4 +2197,4 @@ UNLOCK TABLES;
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2011-01-20 1:49:32
|
||||
-- Dump completed on 2011-04-04 21:03:41
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
-- Update arena_team table
|
||||
ALTER TABLE `arena_team`
|
||||
CHANGE `arenateamid` `arenaTeamId` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `captainguid` `captainGuid` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `BackgroundColor` `backgroundColor` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `EmblemStyle` `emblemStyle` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `EmblemColor` `emblemColor` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `BorderStyle` `borderStyle` TINYINT(3) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `BorderColor` `borderColor` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ADD COLUMN `rating` SMALLINT(5) UNSIGNED NOT NULL AFTER `type`,
|
||||
ADD COLUMN `seasonGames` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL AFTER `rating`,
|
||||
ADD COLUMN `seasonWins` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL AFTER `seasonGames`,
|
||||
ADD COLUMN `weekGames` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL AFTER `seasonWins`,
|
||||
ADD COLUMN `weekWins` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL AFTER `weekGames`,
|
||||
ADD COLUMN `rank` INT(10) UNSIGNED NOT NULL AFTER `weekWins`;
|
||||
|
||||
-- Move data from arena_team_stats to new columns in arena_team
|
||||
UPDATE `arena_team` a, `arena_team_stats` s SET
|
||||
`a`.`rating` = `s`.`rating`,
|
||||
`a`.`seasonGames` = `s`.`played`,
|
||||
`a`.`seasonWins` = `s`.`wins2`,
|
||||
`a`.`weekGames` = `s`.`games`,
|
||||
`a`.`weekWins` = `s`.`wins`,
|
||||
`a`.`rank` = `s`.`rank`
|
||||
WHERE `a`.`arenaTeamId` = `s`.`arenateamid`;
|
||||
|
||||
-- Remove arena_team_stats table
|
||||
DROP TABLE `arena_team_stats`;
|
||||
|
||||
-- Update arena_team_member table
|
||||
ALTER TABLE `arena_team_member`
|
||||
CHANGE `arenateamid` `arenaTeamId` INT(10) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `played_week` `weekGames` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `wons_week` `weekWins` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `played_season` `seasonGames` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
CHANGE `wons_season` `seasonWins` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
ADD COLUMN `personalRating` SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL AFTER `seasonWins`;
|
||||
|
||||
-- Update character_arena_stats table
|
||||
ALTER TABLE `character_arena_stats`
|
||||
CHANGE `personal_rating` `personalRating` SMALLINT(5) NOT NULL,
|
||||
CHANGE `matchmaker_rating` `matchMakerRating` SMALLINT(5) NOT NULL;
|
||||
Reference in New Issue
Block a user