From 0ee7b3d7299123f1debcaec083d27eaafe1117a4 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 11 Nov 2015 16:54:41 -0500 Subject: [PATCH] add hostname to Servers table --- db/zm_update-1.28.109.sql | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 db/zm_update-1.28.109.sql diff --git a/db/zm_update-1.28.109.sql b/db/zm_update-1.28.109.sql new file mode 100644 index 000000000..c23927e26 --- /dev/null +++ b/db/zm_update-1.28.109.sql @@ -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;