* Change sql update naming scheme from absent now revison numbers to date+counter, update old sql update names to preserve proper order.

This commit is contained in:
vladimir-mangos 2008-10-18 01:43:56 +04:00
parent 708440742b
commit 32ad72350f
69 changed files with 128 additions and 125 deletions

View file

@ -1,6 +1,6 @@
UPDATE characters SET data = REPLACE(data,' ',' '); UPDATE characters SET data = REPLACE(data,' ',' ');
UPDATE characters SET data = CONCAT(TRIM(data),' '); UPDATE characters SET data = CONCAT(TRIM(data),' ');
UPDATE characters UPDATE characters
SET data=CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',1396),' ',-1396),' ','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0',' ',SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',1529),' ',-133)) SET data=CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',1396),' ',-1396),' ','0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0',' ',SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',1529),' ',-133))
WHERE SUBSTRING_INDEX(data,' ',1528) = data AND SUBSTRING_INDEX(data,' ',1527) <> data; WHERE SUBSTRING_INDEX(data,' ',1528) = data AND SUBSTRING_INDEX(data,' ',1527) <> data;

View file

@ -1,6 +1,6 @@
UPDATE corpse SET data = REPLACE(data,' ',' '); UPDATE corpse SET data = REPLACE(data,' ',' ');
UPDATE corpse SET data = CONCAT(TRIM(data),' '); UPDATE corpse SET data = CONCAT(TRIM(data),' ');
UPDATE corpse UPDATE corpse
SET data=CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`,' ',8),' ',-8),' ','0 0',' ',SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',39),' ',-31)) SET data=CONCAT(SUBSTRING_INDEX(SUBSTRING_INDEX(`data`,' ',8),' ',-8),' ','0 0',' ',SUBSTRING_INDEX(SUBSTRING_INDEX(data,' ',39),' ',-31))
WHERE SUBSTRING_INDEX(data,' ',38) = data AND SUBSTRING_INDEX(data,' ',37) <> data; WHERE SUBSTRING_INDEX(data,' ',38) = data AND SUBSTRING_INDEX(data,' ',37) <> data;

View file

@ -1,34 +1,34 @@
TRUNCATE `character_instance`; TRUNCATE `character_instance`;
TRUNCATE `instance`; TRUNCATE `instance`;
ALTER TABLE `character_instance` ALTER TABLE `character_instance`
DROP KEY `leader`, DROP KEY `leader`,
DROP PRIMARY KEY, DROP PRIMARY KEY,
ADD PRIMARY KEY `guid` (`guid`,`instance`), ADD PRIMARY KEY `guid` (`guid`,`instance`),
DROP COLUMN `map`, DROP COLUMN `map`,
DROP COLUMN `leader`, DROP COLUMN `leader`,
MODIFY COLUMN `instance` int(11) unsigned NOT NULL default '0', MODIFY COLUMN `instance` int(11) unsigned NOT NULL default '0',
ADD COLUMN `permanent` tinyint(1) unsigned NOT NULL default '0'; ADD COLUMN `permanent` tinyint(1) unsigned NOT NULL default '0';
ALTER TABLE `instance` ALTER TABLE `instance`
ADD COLUMN `difficulty` tinyint(1) unsigned NOT NULL default '0' AFTER `resettime`; ADD COLUMN `difficulty` tinyint(1) unsigned NOT NULL default '0' AFTER `resettime`;
CREATE TABLE `group_instance` ( CREATE TABLE `group_instance` (
`leaderGuid` int(11) unsigned NOT NULL default '0', `leaderGuid` int(11) unsigned NOT NULL default '0',
`instance` int(11) unsigned NOT NULL default '0', `instance` int(11) unsigned NOT NULL default '0',
`permanent` tinyint(1) unsigned NOT NULL default '0', `permanent` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`leaderGuid`,`instance`), PRIMARY KEY (`leaderGuid`,`instance`),
KEY `instance` (`instance`) KEY `instance` (`instance`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `instance_reset` ( CREATE TABLE `instance_reset` (
`mapid` int(11) unsigned NOT NULL default '0', `mapid` int(11) unsigned NOT NULL default '0',
`resettime` bigint(40) NOT NULL default '0', `resettime` bigint(40) NOT NULL default '0',
PRIMARY KEY (`mapid`) PRIMARY KEY (`mapid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `groups` ALTER TABLE `groups`
ADD COLUMN `difficulty` tinyint(3) unsigned NOT NULL default '0' AFTER `isRaid`; ADD COLUMN `difficulty` tinyint(3) unsigned NOT NULL default '0' AFTER `isRaid`;
ALTER TABLE `characters` ALTER TABLE `characters`
ADD COLUMN `dungeon_difficulty` tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER `map`; ADD COLUMN `dungeon_difficulty` tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER `map`;

View file

@ -1,4 +1,4 @@
DELETE FROM spell_affect WHERE entry = 8875 AND effectId = 1 LIMIT 1; DELETE FROM spell_affect WHERE entry = 8875 AND effectId = 1 LIMIT 1;
INSERT INTO spell_affect ( entry , effectId , SpellFamilyMask ) VALUES INSERT INTO spell_affect ( entry , effectId , SpellFamilyMask ) VALUES
(8875, 1, 0x40000000000); (8875, 1, 0x40000000000);

View file

@ -1,56 +1,56 @@
-- --
-- Table structure for table `spell_pet_auras` -- Table structure for table `spell_pet_auras`
-- --
DROP TABLE IF EXISTS `spell_pet_auras`; DROP TABLE IF EXISTS `spell_pet_auras`;
CREATE TABLE `spell_pet_auras` ( CREATE TABLE `spell_pet_auras` (
`spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id', `spell` mediumint(8) unsigned NOT NULL COMMENT 'dummy spell id',
`pet` mediumint(8) unsigned NOT NULL default '0' COMMENT 'pet id; 0 = all', `pet` mediumint(8) unsigned NOT NULL default '0' COMMENT 'pet id; 0 = all',
`aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id', `aura` mediumint(8) unsigned NOT NULL COMMENT 'pet aura id',
PRIMARY KEY (`spell`,`pet`) PRIMARY KEY (`spell`,`pet`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Dumping data for table `spell_pet_auras` -- Dumping data for table `spell_pet_auras`
-- --
LOCK TABLES `spell_pet_auras` WRITE; LOCK TABLES `spell_pet_auras` WRITE;
/*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */; /*!40000 ALTER TABLE `spell_pet_auras` DISABLE KEYS */;
INSERT INTO `spell_pet_auras` VALUES INSERT INTO `spell_pet_auras` VALUES
(19028, 0, 25228), (19028, 0, 25228),
(19578, 0, 19579), (19578, 0, 19579),
(20895, 0, 24529), (20895, 0, 24529),
(28757, 0, 28758), (28757, 0, 28758),
(35029, 0, 35060), (35029, 0, 35060),
(35030, 0, 35061), (35030, 0, 35061),
(35691, 0, 35696), (35691, 0, 35696),
(35692, 0, 35696), (35692, 0, 35696),
(35693, 0, 35696), (35693, 0, 35696),
(23785, 416, 23759), (23785, 416, 23759),
(23822, 416, 23826), (23822, 416, 23826),
(23823, 416, 23827), (23823, 416, 23827),
(23824, 416, 23828), (23824, 416, 23828),
(23825, 416, 23829), (23825, 416, 23829),
(23785, 417, 23762), (23785, 417, 23762),
(23822, 417, 23837), (23822, 417, 23837),
(23823, 417, 23838), (23823, 417, 23838),
(23824, 417, 23839), (23824, 417, 23839),
(23825, 417, 23840), (23825, 417, 23840),
(23785, 1860, 23760), (23785, 1860, 23760),
(23822, 1860, 23841), (23822, 1860, 23841),
(23823, 1860, 23842), (23823, 1860, 23842),
(23824, 1860, 23843), (23824, 1860, 23843),
(23825, 1860, 23844), (23825, 1860, 23844),
(23785, 1863, 23761), (23785, 1863, 23761),
(23822, 1863, 23833), (23822, 1863, 23833),
(23823, 1863, 23834), (23823, 1863, 23834),
(23824, 1863, 23835), (23824, 1863, 23835),
(23825, 1863, 23836), (23825, 1863, 23836),
(23785, 17252, 35702), (23785, 17252, 35702),
(23822, 17252, 35703), (23822, 17252, 35703),
(23823, 17252, 35704), (23823, 17252, 35704),
(23824, 17252, 35705), (23824, 17252, 35705),
(23825, 17252, 35706); (23825, 17252, 35706);
/*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */; /*!40000 ALTER TABLE `spell_pet_auras` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;

View file

@ -1 +1 @@
DELETE FROM mangos_string WHERE entry IN (800); DELETE FROM mangos_string WHERE entry IN (800);

View file

@ -1,3 +1,3 @@
DELETE FROM command WHERE name = 'reload all_locales'; DELETE FROM command WHERE name = 'reload all_locales';
INSERT INTO `command` VALUES INSERT INTO `command` VALUES
('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.'); ('reload all_locales',3,'Syntax: .reload all_locales\r\n\r\nReload all `locales_*` tables with reload support added and that can be _safe_ reloaded.');

View file

@ -12,22 +12,25 @@ To see if you need an update, the file names have been given a fixed structure
that should enable you to see if you need an update or not. that should enable you to see if you need an update or not.
=== File name descriptin === === File name descriptin ===
File names are divided into two parts. First part is the revision that will be File names are divided into two parts. First part is the date+counter
compatible with database after apply update. The second part of the name, that show commit apply date that will be compatible with database after apply update.
is the table that needs and update or has been added. See an example below: The second part of the name, is the table that needs and update or has been added.
See an example below:
1123_characters_character_spell.sql 2008_10_17_01_characters_character_spell.sql
| | | | | | |
| | | | | | |
| | The table character_spell | | | The table character_spell
| | will need an update. | | | will need an update.
| | | | |
| Name of affected DB (default recommended name) | | Name of affected DB (default recommended name)
| Can be: characters, mangos, realmd | | Can be: characters, mangos, realmd
| |
| Counter show number of sql update in updates list for provided data
| and set proper order for sql updates for some date
| |
MaNGOS revision older 1123 will need this update. MaNGOS commit date related to sql update. For related commit
After appling this update DB compatiable with revision 1122 you can see http://github.com/mangos/mangos/commits/master
will be compatibale with revision 1123. Expected commit will be in commits list for provided date and it will have
Revision 1123 and any revision after 1123, e.g. 1124 or 1137, sql update file name (2008_10_17_01_characters_character_spell.sql in our case) in list
already includes this update in the default database changed files, After appling this update DB compatiable with found commit.
file mangos.sql.