fix(db_world): ensure attributeMask exists before 2023_07_17_01 update
The column was introduced in old/9.x SQL but not in the archive chain; fresh archive-only installs lacked the column. Add idempotent ALTER via INFORMATION_SCHEMA before updating spell_enchant_proc_data. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,3 +1,19 @@
|
|||||||
-- DB update 2023_07_17_00 -> 2023_07_17_01
|
-- DB update 2023_07_17_00 -> 2023_07_17_01
|
||||||
--
|
--
|
||||||
|
SET @attrmask_exists := (
|
||||||
|
SELECT COUNT(*)
|
||||||
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
|
WHERE TABLE_SCHEMA = DATABASE()
|
||||||
|
AND TABLE_NAME = 'spell_enchant_proc_data'
|
||||||
|
AND COLUMN_NAME = 'attributeMask'
|
||||||
|
);
|
||||||
|
SET @sql := IF(
|
||||||
|
@attrmask_exists > 0,
|
||||||
|
'SELECT 1',
|
||||||
|
'ALTER TABLE `spell_enchant_proc_data` ADD COLUMN `attributeMask` INT UNSIGNED NOT NULL DEFAULT 0 AFTER `procEx`'
|
||||||
|
);
|
||||||
|
PREPARE stmt FROM @sql;
|
||||||
|
EXECUTE stmt;
|
||||||
|
DEALLOCATE PREPARE stmt;
|
||||||
|
|
||||||
UPDATE `spell_enchant_proc_data` SET `attributeMask` = 0x2 WHERE `entry` = 2675;
|
UPDATE `spell_enchant_proc_data` SET `attributeMask` = 0x2 WHERE `entry` = 2675;
|
||||||
|
|||||||
Reference in New Issue
Block a user