From a19e6b619c293580b0639909196f33ca5e0134fd Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 28 Feb 2018 07:17:52 -0800 Subject: [PATCH] add Encoder to Monitors --- db/zm_update-1.31.40.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 db/zm_update-1.31.40.sql diff --git a/db/zm_update-1.31.40.sql b/db/zm_update-1.31.40.sql new file mode 100644 index 000000000..66b98eb66 --- /dev/null +++ b/db/zm_update-1.31.40.sql @@ -0,0 +1,14 @@ +ALTER TABLE `Monitors` MODIFY `OutputCodec` int(10) UNSIGNED NOT NULL default 0; + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Monitors' + AND column_name = 'Encoder' + ) > 0, +"SELECT 'Column Encoder already exists in Monitors'", +"ALTER TABLE `Monitors` ADD `Encoder` enum('auto','h264','h264_omx','mjpeg','mpeg1','mpeg2') AFTER `OutputCodec`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; +