aboutsummaryrefslogtreecommitdiff
path: root/sql/base/characters_database.sql
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2015-03-21 20:11:23 +0100
committerNayd <dnpd.dd@gmail.com>2015-03-21 20:54:54 +0000
commit2bd1c8541d638f5041a92f491f02919270981bc2 (patch)
treec2472304f260f8f3553cc86b4de1e19042c01807 /sql/base/characters_database.sql
parent236e43443c644a9a50cb48ff7300950c928d336c (diff)
Core/Updates: Add an automatic database update system. Automatically detects new and edited sql updates through file lists and hashing. Detects renames, deletes and is able to create and auto import full databases. * cleanups in main.cpp of world & bnetserver * refactoring in DatabaseWorkerPool.h & MySQLConnection.cpp
Make sure you re-run cmake, because boost::iostreams was added as dependency. Maybe you need to install libboost-iostreams1.55-dev on unix as well. Import every update manual until (included) those INSERT IGNORE updates for each database. Thanks DDuarte and Shauren for your amazing ideas, help and advises. In hope that nobody gets a "Your database structure is not up to date..." anymore ,-) (cherry picked from commit 352012e53173372ebc82898e1b6854c983b01b25) (cherry picked from commit 1f7f9feafc3f5017d617634ae993d2cdf4430920) For 3.3.5: * Synchronized ConfigureBoost.cmake with 6.x, libboost-filesystem1.55-dev also added as dependency! Signed-off-by: Naios <naios-dev@live.de> Signed-off-by: Nayd <dnpd.dd@gmail.com>
Diffstat (limited to 'sql/base/characters_database.sql')
-rw-r--r--sql/base/characters_database.sql36
1 files changed, 36 insertions, 0 deletions
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index 096cd0424e1..795be321d7d 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -2546,3 +2546,39 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2014-10-18 18:02:06
+
+-- Updates base tables
+DROP TABLE IF EXISTS `updates`;
+CREATE TABLE `updates` (
+ `name` VARCHAR(200) NOT NULL COMMENT 'filename with extension of the update.',
+ `hash` CHAR(40) NULL DEFAULT '' COMMENT 'sha1 hash of the sql file.',
+ `state` ENUM('RELEASED','ARCHIVED') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.',
+ `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'timestamp when the query was applied.',
+ `speed` INT(10) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'time the query takes to apply in ms.',
+ PRIMARY KEY (`name`)
+)
+COMMENT='List of all applied updates in this database.'
+COLLATE='utf8_general_ci'
+ENGINE=MyISAM;
+
+DROP TABLE IF EXISTS `updates_include`;
+CREATE TABLE `updates_include` (
+ `path` VARCHAR(200) NOT NULL COMMENT 'directory to include. $ means relative to the source directory.',
+ `state` ENUM('RELEASED','ARCHIVED') NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.',
+ PRIMARY KEY (`path`)
+)
+COMMENT='List of directories where we want to include sql updates.'
+COLLATE='utf8_general_ci'
+ENGINE=MyISAM;
+
+-- Characters database update data
+TRUNCATE TABLE `updates_include`;
+INSERT INTO `updates_include` (`path`, `state`) VALUES
+('$/sql/updates/characters', 'RELEASED'),
+('$/sql/custom/characters', 'RELEASED'),
+('$/sql/old/3.3.5a/characters', 'ARCHIVED');
+
+INSERT IGNORE INTO `updates` (`name`, `hash`) VALUES
+('2015_03_20_00_characters.sql', 'B761760804EA73BD297F296C5C1919687DF7191C'),
+('2015_03_20_01_characters.sql', '894F08B70449A5481FFAF394EE5571D7FC4D8A3A'),
+('2015_03_20_02_characters.sql', '');