From 786dcb0dc1099de02950cfb66d3e192edfc708a9 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 11 Jul 2017 14:31:41 -0400 Subject: [PATCH] Add orientation to Events --- db/zm_update-1.31.3.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/db/zm_update-1.31.3.sql b/db/zm_update-1.31.3.sql index 38f500c41..be3cb7217 100644 --- a/db/zm_update-1.31.3.sql +++ b/db/zm_update-1.31.3.sql @@ -60,3 +60,18 @@ UPDATE Monitors SET StorageId = 0 WHERE StorageId IS NULL; ALTER TABLE Monitors MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0; UPDATE Events SET StorageId = 0 WHERE StorageId IS NULL; ALTER TABLE Events MODIFY `StorageId` smallint(5) unsigned NOT NULL default 0; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Events' + AND table_schema = DATABASE() + AND column_name = 'Orientation' + ) > 0, +"SELECT 'Column Orientation exists in Events'", +"ALTER TABLE `Events` ADD `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0' AFTER `Notes`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; +~