Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8402] Optimalized guild_eventlog and guild_bank_eventlog loading fro…
…m database. Added config options to set count of eventlog records stored in DB. Attached SQL files will DROP existing and create new tables. Make sure you create backup (if you need old data). Renamed few variables in Guild class. Signed-off-by: Triply <triply@getmangos.com>
- Loading branch information
Showing
15 changed files
with
464 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ALTER TABLE character_db_version CHANGE COLUMN required_8397_03_characters_character_spell required_8402_01_characters_guild_eventlog bit; | ||
|
||
|
||
-- THIS SCRIPT DELETES table `guild_eventlog` - MAKE BACKUP, if you need it. | ||
|
||
DROP TABLE IF EXISTS `guild_eventlog`; | ||
CREATE TABLE `guild_eventlog` ( | ||
`guildid` int(11) NOT NULL COMMENT 'Guild Identificator', | ||
`LogGuid` int(11) NOT NULL COMMENT 'Log record identificator - auxiliary column', | ||
`EventType` tinyint(1) NOT NULL COMMENT 'Event type', | ||
`PlayerGuid1` int(11) NOT NULL COMMENT 'Player 1', | ||
`PlayerGuid2` int(11) NOT NULL COMMENT 'Player 2', | ||
`NewRank` tinyint(2) NOT NULL COMMENT 'New rank(in case promotion/demotion)', | ||
`TimeStamp` bigint(20) NOT NULL COMMENT 'Event UNIX time', | ||
PRIMARY KEY (`guildid`, `LogGuid`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT 'Guild Eventlog'; | ||
|
||
-- The reason i decided for such dramatic change is that old guild_eventlog table didn't have Primary key and | ||
-- used LogGuids from 0 to infinity | ||
-- New system uses LogGuids from 0 to number defined in config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ALTER TABLE character_db_version CHANGE COLUMN required_8402_01_characters_guild_eventlog required_8402_02_characters_guild_bank_eventlog bit; | ||
|
||
|
||
-- THIS SCRIPT DELETES table `guild_bank_eventlog` - MAKE BACKUP, if you need it. | ||
|
||
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`) | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
||
-- The reason i decided for such dramatic change is that old guild_bank_eventlog table used `TabId` = 0 for Money events and | ||
-- used `LogGuid` from 0 to infinity | ||
-- New system uses `LogGuid` from 0 to number defined in config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.