diff --git a/db/zm_update-1.31.18.sql b/db/zm_update-1.31.18.sql index 56e15dd3a..fd000bcfa 100644 --- a/db/zm_update-1.31.18.sql +++ b/db/zm_update-1.31.18.sql @@ -10,3 +10,14 @@ SET @s = (SELECT IF( PREPARE stmt FROM @s; EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM Filters WHERE Name = 'Update DiskSpace' + AND Query = '{"terms":[{"attr":"DiskSpace","op":"IS","val":"NULL"}],"sort_field":"Id","sort_asc":"1","limit":"100"}' + ) > 0, + "SELECT 'Update Disk Space Filter already exists.'", + "INSERT INTO Filters (Name,Query,UpdateDiskSpace,Background) values ('Update DiskSpace','{\"terms\":[{\"attr\":\"DiskSpace\",\"op\":\"IS\",\"val\":\"NULL\"}],\"sort_field\":\"Id\",\"sort_asc\":\"1\",\"limit\":\"100\"}',1,1)" + )); + +PREPARE stmt FROM @s; +EXECUTE stmt;