move add ServerId to Monitors to zm_update-1.28.100.sql

This commit is contained in:
Isaac Connor 2015-07-14 16:09:01 -04:00
parent 04366e752a
commit 2819585cdb
2 changed files with 22 additions and 15 deletions

22
db/zm_update-1.28.100.sql Normal file
View File

@ -0,0 +1,22 @@
--
-- This updates a 1.28.10 database to 1.28.99
--
--
-- Add ServerId column to Monitors
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'ServerId'
) > 0,
"SELECT 'Column ServerId exists in Monitors'",
"ALTER TABLE Monitors ADD `ServerId` int(10) unsigned AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -357,21 +357,6 @@ SET @s = (SELECT IF(
)"
));
--
-- Add ServerId column to Monitors
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'ServerId'
) > 0,
"SELECT 'Column ServerId exists in Monitors'",
"ALTER TABLE Monitors ADD `ServerId` int(10) unsigned AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;