From 99c602e83db7858d9ff8ccf8992e627a3dc68762 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Thu, 28 Sep 2017 12:23:23 -0400 Subject: [PATCH] add ParentId to Groups, bump version --- db/zm_create.sql.in | 1 + db/zm_update-1.31.5.sql | 17 +++++++++++++++++ version | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 db/zm_update-1.31.5.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 659981407..7a67c7e59 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -264,6 +264,7 @@ DROP TABLE IF EXISTS `Groups`; CREATE TABLE `Groups` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', + `ParentId` int(10) unsigned, `MonitorIds` tinytext NOT NULL, PRIMARY KEY (`Id`) ) ENGINE=@ZM_MYSQL_ENGINE@; diff --git a/db/zm_update-1.31.5.sql b/db/zm_update-1.31.5.sql new file mode 100644 index 000000000..859487e88 --- /dev/null +++ b/db/zm_update-1.31.5.sql @@ -0,0 +1,17 @@ +-- +-- Add StorageId column to Monitors +-- + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Groups' + AND table_schema = DATABASE() + AND column_name = 'ParentId' + ) > 0, +"SELECT 'Column GroupId exists in Groups'", +"ALTER TABLE Groups ADD `ParentId` int(10) unsigned AFTER `Name`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; diff --git a/version b/version index cca52685e..490b76e45 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.4 +1.31.5