From 4e4c7502c3a6f206009dfeb5e8c610dd4afcbd8d Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 11 Dec 2018 10:37:52 -0500 Subject: [PATCH] put sql update into zm_update-1.33.0.sql --- db/zm_update-1.33.0.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 db/zm_update-1.33.0.sql diff --git a/db/zm_update-1.33.0.sql b/db/zm_update-1.33.0.sql new file mode 100644 index 000000000..2e2d227e1 --- /dev/null +++ b/db/zm_update-1.33.0.sql @@ -0,0 +1,18 @@ +-- +-- This updates a 1.32.* database to 1.33.0 +-- +-- Remove DefaultView from Monitors table. + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'DefaultView' + ) > 0, +"ALTER TABLE Monitors DROP COLUMN DefaultView" +"SELECT 'Column DefaultView no longer exists in Monitors'", +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;