From 3802d169222d81c54f379acf9549e1732acbb872 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 15 Dec 2015 12:09:11 -0500 Subject: [PATCH] add ServerId to Events Table --- db/zm_update-1.28.110.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/db/zm_update-1.28.110.sql b/db/zm_update-1.28.110.sql index 41662d2a4..7bebd88f1 100644 --- a/db/zm_update-1.28.110.sql +++ b/db/zm_update-1.28.110.sql @@ -38,3 +38,20 @@ SET @s = (SELECT IF( PREPARE stmt FROM @s; EXECUTE stmt; +-- +-- Add StorageId column to Eventss +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Events' + AND table_schema = DATABASE() + AND column_name = 'StorageId' + ) > 0, +"SELECT 'Column StorageId exists in Events'", +"ALTER TABLE Events ADD `StorageId` smallint(5) unsigned AFTER `MonitorId`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;