From b25958df142eede8c81350f4e58e77b7d4f09e99 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 17 Sep 2015 16:07:04 -0400 Subject: [PATCH] add a check for StateId --- db/zm_update-1.28.107.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/db/zm_update-1.28.107.sql b/db/zm_update-1.28.107.sql index a5f75c9d8..a44dc76ad 100644 --- a/db/zm_update-1.28.107.sql +++ b/db/zm_update-1.28.107.sql @@ -2,6 +2,23 @@ -- This updates a 1.28.105 database to 1.28.106 -- +-- +-- Add Monitor StateId field +-- +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Servers' + AND table_schema = DATABASE() + AND column_name = 'StateId' + ) > 0, +"SELECT 'Column StateId already exists in Servers'", +"ALTER TABLE `Servers` ADD `StateId` int(10) unsigned AFTER `Name`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + -- -- Add Monitor RTSPDescribe field -- Used to enable or disable processing of the remote camera RTSP DESCRIBE response header