add hostname to Servers table

This commit is contained in:
Isaac Connor 2015-11-11 16:54:41 -05:00
parent 5e70146b0e
commit 0ee7b3d729
1 changed files with 21 additions and 0 deletions

21
db/zm_update-1.28.109.sql Normal file
View File

@ -0,0 +1,21 @@
--
-- This updates a 1.28.106 database to 1.28.107
--
--
-- Update Frame table to have a PrimaryKey of ID, insetad of a Composite Primary Key
-- Used primarially for compatibility with CakePHP
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Servers'
AND table_schema = DATABASE()
AND column_name = 'Hostname'
) > 0,
"SELECT 'Column Hostname already exists in Servers'",
"ALTER TABLE `Servers` ADD COLUMN `Hostname` TEXT AFTER Name",
));
PREPARE stmt FROM @s;
EXECUTE stmt;