mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
feat(Core/DBUpdater): implement db auto update (#6576)
* feat(Core/DBUpdater): implement db auto update * 1 * 2 * 3 * Some minor improvements * add find bin for mysql 8.0 * lic Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
12
data/sql/base/db_auth/updates.sql
Normal file
12
data/sql/base/db_auth/updates.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates`;
|
||||
CREATE TABLE `updates` (
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'filename with extension of the update.',
|
||||
`hash` char(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'sha1 hash of the sql file.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.',
|
||||
`timestamp` timestamp(0) NOT NULL DEFAULT current_timestamp COMMENT 'timestamp when the query was applied.',
|
||||
`speed` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'time the query takes to apply in ms.',
|
||||
PRIMARY KEY (`name`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of all applied updates in this database.' ROW_FORMAT = Dynamic;
|
||||
15
data/sql/base/db_auth/updates_include.sql
Normal file
15
data/sql/base/db_auth/updates_include.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates_include
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates_include`;
|
||||
CREATE TABLE `updates_include` (
|
||||
`path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'directory to include. $ means relative to the source directory.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.',
|
||||
PRIMARY KEY (`path`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of directories where we want to include sql updates.' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of updates_include
|
||||
-- ----------------------------
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/updates/db_auth', 'RELEASED');
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/custom/db_auth', 'CUSTOM');
|
||||
12
data/sql/base/db_characters/updates.sql
Normal file
12
data/sql/base/db_characters/updates.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates`;
|
||||
CREATE TABLE `updates` (
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'filename with extension of the update.',
|
||||
`hash` char(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'sha1 hash of the sql file.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.',
|
||||
`timestamp` timestamp(0) NOT NULL DEFAULT current_timestamp COMMENT 'timestamp when the query was applied.',
|
||||
`speed` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'time the query takes to apply in ms.',
|
||||
PRIMARY KEY (`name`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of all applied updates in this database.' ROW_FORMAT = Dynamic;
|
||||
15
data/sql/base/db_characters/updates_include.sql
Normal file
15
data/sql/base/db_characters/updates_include.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates_include
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates_include`;
|
||||
CREATE TABLE `updates_include` (
|
||||
`path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'directory to include. $ means relative to the source directory.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.',
|
||||
PRIMARY KEY (`path`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of directories where we want to include sql updates.' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of updates_include
|
||||
-- ----------------------------
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/updates/db_characters', 'RELEASED');
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/custom/db_characters', 'CUSTOM');
|
||||
12
data/sql/base/db_world/updates.sql
Normal file
12
data/sql/base/db_world/updates.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates`;
|
||||
CREATE TABLE `updates` (
|
||||
`name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'filename with extension of the update.',
|
||||
`hash` char(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT 'sha1 hash of the sql file.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if an update is released or archived.',
|
||||
`timestamp` timestamp(0) NOT NULL DEFAULT current_timestamp COMMENT 'timestamp when the query was applied.',
|
||||
`speed` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'time the query takes to apply in ms.',
|
||||
PRIMARY KEY (`name`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of all applied updates in this database.' ROW_FORMAT = Dynamic;
|
||||
15
data/sql/base/db_world/updates_include.sql
Normal file
15
data/sql/base/db_world/updates_include.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- ----------------------------
|
||||
-- Table structure for updates_include
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `updates_include`;
|
||||
CREATE TABLE `updates_include` (
|
||||
`path` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'directory to include. $ means relative to the source directory.',
|
||||
`state` enum('RELEASED','ARCHIVED','CUSTOM') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'RELEASED' COMMENT 'defines if the directory contains released or archived updates.',
|
||||
PRIMARY KEY (`path`) USING BTREE
|
||||
) ENGINE = MyISAM CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = 'List of directories where we want to include sql updates.' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of updates_include
|
||||
-- ----------------------------
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/updates/db_world', 'RELEASED');
|
||||
INSERT INTO `updates_include` VALUES ('$/data/sql/custom/db_world', 'CUSTOM');
|
||||
Reference in New Issue
Block a user