2018-10-16 05:14:57 +08:00
|
|
|
--
|
|
|
|
-- This updates a 1.32.2 database to 1.32.3
|
|
|
|
--
|
|
|
|
|
2018-11-22 23:04:33 +08:00
|
|
|
--
|
|
|
|
-- Add Protocol column to Storage
|
|
|
|
--
|
|
|
|
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
|
|
|
AND table_name = 'Servers'
|
|
|
|
AND column_name = 'Protocol'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column Protocol already exists in Servers'",
|
|
|
|
"ALTER TABLE Servers ADD `Protocol` TEXT AFTER `Id`"
|
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|
|
|
|
--
|
2018-11-28 06:35:25 +08:00
|
|
|
-- Add PathToIndex column to Storage
|
|
|
|
--
|
|
|
|
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
|
|
|
AND table_name = 'Servers'
|
|
|
|
AND column_name = 'PathToIndex'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column PathToIndex already exists in Servers'",
|
|
|
|
"ALTER TABLE Servers ADD `PathToIndex` TEXT AFTER `Hostname`"
|
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add PathToZMS column to Storage
|
2018-11-22 23:04:33 +08:00
|
|
|
--
|
|
|
|
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
|
|
|
AND table_name = 'Servers'
|
2018-11-28 06:35:25 +08:00
|
|
|
AND column_name = 'PathToZMS'
|
2018-11-22 23:04:33 +08:00
|
|
|
) > 0,
|
2018-11-28 06:35:25 +08:00
|
|
|
"SELECT 'Column PathToZMS already exists in Servers'",
|
|
|
|
"ALTER TABLE Servers ADD `PathToZMS` TEXT AFTER `PathToIndex`"
|
2018-11-22 23:04:33 +08:00
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add Port column to Storage
|
|
|
|
--
|
|
|
|
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
|
|
|
AND table_name = 'Servers'
|
|
|
|
AND column_name = 'Port'
|
|
|
|
) > 0,
|
|
|
|
"SELECT 'Column Port already exists in Servers'",
|
|
|
|
"ALTER TABLE Servers ADD `Port` INTEGER UNSIGNED AFTER `Hostname`"
|
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|