From e2df6e507437ffa7b9a9b13299b2fc4403462f8e Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 13 Dec 2021 15:00:03 -0500 Subject: [PATCH] Add ExecuteInterval to Filters --- db/zm_create.sql.in | 1 + db/zm_update-1.37.6.sql | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 db/zm_update-1.37.6.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index bf598b646..fbc7cad3c 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -283,6 +283,7 @@ CREATE TABLE `Filters` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', `UserId` int(10) unsigned, + `ExecuteInterval` int(10) unsigned NOT NULL default '60', `Query_json` text NOT NULL, `AutoArchive` tinyint(3) unsigned NOT NULL default '0', `AutoUnarchive` tinyint(3) unsigned NOT NULL default '0', diff --git a/db/zm_update-1.37.6.sql b/db/zm_update-1.37.6.sql new file mode 100644 index 000000000..7c79886ad --- /dev/null +++ b/db/zm_update-1.37.6.sql @@ -0,0 +1,18 @@ +-- +-- Update Filters table to have a ExecuteInterval Column +-- + +SELECT 'Checking for ExecuteInterval in Filters'; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Filters' + AND table_schema = DATABASE() + AND column_name = 'ExecuteInterval' + ) > 0, +"SELECT 'Column ExecuteInterval already exists in Filters'", +"ALTER TABLE Filters ADD COLUMN `ExecuteInterval` int(10) unsigned NOT NULL default '60' AFTER `UserId`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;