Permalink
Browse files

[12562] Remove not required duplicate indexes

Signed-off-by: Schmoozerd <schmoozerd@cmangos>
  • Loading branch information...
1 parent 1dab065 commit a5c7fcc1d32d7cc8a65eaba91caf40edad4fce1e Dimitri Savineau committed with rsa Sep 14, 2013
View
@@ -21,7 +21,7 @@
DROP TABLE IF EXISTS `character_db_version`;
CREATE TABLE `character_db_version` (
- `required_12487_01_characters_characters` bit(1) default NULL
+ `required_12562_01_characters_various_tables` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Last applied sql update to DB';
--
@@ -714,10 +714,9 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `character_queststatus_daily`;
CREATE TABLE `character_queststatus_daily` (
- `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
- `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
- PRIMARY KEY (`guid`,`quest`),
- KEY `idx_guid` (`guid`)
+ `guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
+ `quest` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`guid`,`quest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
--
@@ -735,10 +734,9 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `character_queststatus_monthly`;
CREATE TABLE `character_queststatus_monthly` (
- `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
- `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
- PRIMARY KEY (`guid`,`quest`),
- KEY `idx_guid` (`guid`)
+ `guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
+ `quest` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`guid`,`quest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
--
@@ -756,10 +754,9 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `character_queststatus_weekly`;
CREATE TABLE `character_queststatus_weekly` (
- `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier',
- `quest` int(11) unsigned NOT NULL default '0' COMMENT 'Quest Identifier',
- PRIMARY KEY (`guid`,`quest`),
- KEY `idx_guid` (`guid`)
+ `guid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
+ `quest` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier',
+ PRIMARY KEY (`guid`,`quest`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
--
@@ -825,9 +822,7 @@ CREATE TABLE `character_social` (
`friend` int(11) unsigned NOT NULL default '0' COMMENT 'Friend Global Unique Identifier',
`flags` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Friend Flags',
`note` varchar(48) NOT NULL DEFAULT '' COMMENT 'Friend Note',
- PRIMARY KEY (`guid`,`friend`,`flags`),
- KEY `guid` (`guid`),
- KEY `friend` (`friend`),
+ PRIMARY KEY (`guid`,`friend`,`flags`),
KEY `guid_flags` (`guid`,`flags`),
KEY `friend_flags` (`friend`,`flags`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
@@ -945,9 +940,8 @@ CREATE TABLE `character_talent` (
`current_rank` tinyint(3) unsigned NOT NULL DEFAULT '0',
`spec` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`,`talent_id`,`spec`),
- KEY guid_key (`guid`),
- KEY talent_key (`talent_id`),
- KEY spec_key (`spec`)
+ KEY `talent_key` (`talent_id`),
+ KEY `spec_key` (`spec`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@@ -1222,19 +1216,18 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `guild_bank_eventlog`;
CREATE TABLE `guild_bank_eventlog` (
- `guildid` int(11) unsigned NOT NULL default '0' COMMENT 'Guild Identificator',
- `LogGuid` int(11) unsigned NOT NULL default '0' COMMENT 'Log record identificator - auxiliary column',
- `TabId` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Guild bank TabId',
- `EventType` tinyint(3) unsigned NOT NULL default '0' COMMENT 'Event type',
- `PlayerGuid` int(11) unsigned NOT NULL default '0',
- `ItemOrMoney` int(11) unsigned NOT NULL default '0',
- `ItemStackCount` tinyint(3) unsigned NOT NULL default '0',
- `DestTabId` tinyint(1) unsigned NOT NULL default '0' COMMENT 'Destination Tab Id',
- `TimeStamp` bigint(20) unsigned NOT NULL default '0' COMMENT 'Event UNIX time',
- PRIMARY KEY (`guildid`,`LogGuid`,`TabId`),
- KEY `guildid_key` (`guildid`),
- INDEX `Idx_PlayerGuid`(`PlayerGuid`),
- INDEX `Idx_LogGuid`(`LogGuid`)
+ `guildid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Guild Identificator',
+ `LogGuid` int(11) unsigned NOT NULL DEFAULT '0' COMMENT 'Log record identificator - auxiliary column',
+ `TabId` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Guild bank TabId',
+ `EventType` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Event type',
+ `PlayerGuid` int(11) unsigned NOT NULL DEFAULT '0',
+ `ItemOrMoney` int(11) unsigned NOT NULL DEFAULT '0',
+ `ItemStackCount` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `DestTabId` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT 'Destination Tab Id',
+ `TimeStamp` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Event UNIX time',
+ PRIMARY KEY (`guildid`,`LogGuid`,`TabId`),
+ KEY `Idx_PlayerGuid` (`PlayerGuid`),
+ KEY `Idx_LogGuid` (`LogGuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@@ -1252,14 +1245,13 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `guild_bank_item`;
CREATE TABLE `guild_bank_item` (
- `guildid` int(11) unsigned NOT NULL default '0',
- `TabId` tinyint(1) unsigned NOT NULL default '0',
- `SlotId` tinyint(3) unsigned NOT NULL default '0',
- `item_guid` int(11) unsigned NOT NULL default '0',
- `item_entry` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`guildid`,`tabid`,`slotid`),
- KEY `guildid_key` (`guildid`),
- INDEX `Idx_item_guid`(`item_guid`)
+ `guildid` int(11) unsigned NOT NULL DEFAULT '0',
+ `TabId` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ `SlotId` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `item_guid` int(11) unsigned NOT NULL DEFAULT '0',
+ `item_entry` int(11) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`guildid`,`TabId`,`SlotId`),
+ KEY `Idx_item_guid` (`item_guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@@ -1277,13 +1269,12 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `guild_bank_right`;
CREATE TABLE `guild_bank_right` (
- `guildid` int(11) unsigned NOT NULL default '0',
- `TabId` tinyint(1) unsigned NOT NULL default '0',
- `rid` int(11) unsigned NOT NULL default '0',
- `gbright` tinyint(3) unsigned NOT NULL default '0',
- `SlotPerDay` int(11) unsigned NOT NULL default '0',
- PRIMARY KEY (`guildid`,`TabId`,`rid`),
- KEY `guildid_key` (`guildid`)
+ `guildid` int(11) unsigned NOT NULL DEFAULT '0',
+ `TabId` tinyint(1) unsigned NOT NULL DEFAULT '0',
+ `rid` int(11) unsigned NOT NULL DEFAULT '0',
+ `gbright` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `SlotPerDay` int(11) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`guildid`,`TabId`,`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@@ -1306,8 +1297,7 @@ CREATE TABLE `guild_bank_tab` (
`TabName` varchar(100) NOT NULL default '',
`TabIcon` varchar(100) NOT NULL default '',
`TabText` text,
- PRIMARY KEY (`guildid`,`TabId`),
- KEY `guildid_key` (`guildid`)
+ PRIMARY KEY (`guildid`,`TabId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
@@ -1353,28 +1343,27 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `guild_member`;
CREATE TABLE `guild_member` (
- `guildid` int(6) unsigned NOT NULL default '0',
- `guid` int(11) unsigned NOT NULL default '0',
- `rank` tinyint(2) unsigned NOT NULL default '0',
- `pnote` varchar(255) NOT NULL default '',
- `offnote` varchar(255) NOT NULL default '',
- `BankResetTimeMoney` int(11) unsigned NOT NULL default '0',
- `BankRemMoney` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab0` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab0` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab1` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab1` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab2` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab2` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab3` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab3` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab4` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab4` int(11) unsigned NOT NULL default '0',
- `BankResetTimeTab5` int(11) unsigned NOT NULL default '0',
- `BankRemSlotsTab5` int(11) unsigned NOT NULL default '0',
- KEY `guildid_key` (`guildid`),
- KEY `guildid_rank_key` (`guildid`,`rank`),
- UNIQUE KEY `guid_key` (`guid`)
+ `guildid` int(6) unsigned NOT NULL DEFAULT '0',
+ `guid` int(11) unsigned NOT NULL DEFAULT '0',
+ `rank` tinyint(2) unsigned NOT NULL DEFAULT '0',
+ `pnote` varchar(255) NOT NULL DEFAULT '',
+ `offnote` varchar(255) NOT NULL DEFAULT '',
+ `BankResetTimeMoney` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemMoney` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab0` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab0` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab1` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab1` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab2` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab2` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab3` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab3` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab4` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab4` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankResetTimeTab5` int(11) unsigned NOT NULL DEFAULT '0',
+ `BankRemSlotsTab5` int(11) unsigned NOT NULL DEFAULT '0',
+ UNIQUE KEY `guid_key` (`guid`),
+ KEY `guildid_rank_key` (`guildid`,`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Guild System';
--
View
@@ -21,10 +21,10 @@
DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
- `version` varchar(120) default NULL,
- `creature_ai_version` varchar(120) default NULL,
- `cache_id` int(10) default '0',
- `required_12540_01_mangos_command` bit(1) default NULL
+ `version` varchar(120) DEFAULT NULL,
+ `creature_ai_version` varchar(120) DEFAULT NULL,
+ `cache_id` int(10) DEFAULT '0',
+ `required_12562_01_mangos_playercreateinfo_action` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -10615,12 +10615,11 @@ UNLOCK TABLES;
DROP TABLE IF EXISTS `playercreateinfo_action`;
CREATE TABLE `playercreateinfo_action` (
- `race` tinyint(3) unsigned NOT NULL default '0',
- `class` tinyint(3) unsigned NOT NULL default '0',
- `button` smallint(5) unsigned NOT NULL default '0',
- `action` int(11) unsigned NOT NULL default '0',
- `type` smallint(5) unsigned NOT NULL default '0',
- KEY `playercreateinfo_race_class_index` (`race`,`class`),
+ `race` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `class` tinyint(3) unsigned NOT NULL DEFAULT '0',
+ `button` smallint(5) unsigned NOT NULL DEFAULT '0',
+ `action` int(11) unsigned NOT NULL DEFAULT '0',
+ `type` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`race`,`class`,`button`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -0,0 +1,13 @@
+ALTER TABLE character_db_version CHANGE COLUMN required_12487_01_characters_characters required_12562_01_characters_various_tables bit;
+
+ALTER TABLE character_queststatus_daily DROP INDEX idx_guid;
+ALTER TABLE character_queststatus_monthly DROP INDEX idx_guid;
+ALTER TABLE character_queststatus_weekly DROP INDEX idx_guid;
+ALTER TABLE character_social DROP INDEX friend;
+ALTER TABLE character_social DROP INDEX guid;
+ALTER TABLE character_talent DROP INDEX guid_key;
+ALTER TABLE guild_bank_eventlog DROP INDEX guildid_key;
+ALTER TABLE guild_bank_item DROP INDEX guildid_key;
+ALTER TABLE guild_bank_right DROP INDEX guildid_key;
+ALTER TABLE guild_bank_tab DROP INDEX guildid_key;
+ALTER TABLE guild_member DROP INDEX guildid_key;
@@ -0,0 +1,3 @@
+ALTER TABLE db_version CHANGE COLUMN required_12540_01_mangos_command required_12562_01_mangos_playercreateinfo_action bit;
+
+ALTER TABLE playercreateinfo_action DROP INDEX playercreateinfo_race_class_index;
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "12559"
+ #define REVISION_NR "12562"
#endif // __REVISION_NR_H__
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
- #define REVISION_DB_CHARACTERS "required_12487_01_characters_characters"
- #define REVISION_DB_MANGOS "required_12540_01_mangos_command"
+ #define REVISION_DB_CHARACTERS "required_12562_01_characters_various_tables"
+ #define REVISION_DB_MANGOS "required_12562_01_mangos_playercreateinfo_action"
#define REVISION_DB_REALMD "required_12112_01_realmd_account_access"
#endif // __REVISION_SQL_H__

0 comments on commit a5c7fcc

Please sign in to comment.