diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index b648e5c54..86439feca 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -467,6 +467,7 @@ CREATE TABLE `Monitors` ( `JanusAudioEnabled` BOOLEAN NOT NULL default false, `Janus_Profile_Override` VARCHAR(30) NOT NULL DEFAULT '', `Janus_Use_RTSP_Restream` BOOLEAN NOT NULL default false, + `Janus_RTSP_User` INT(10), `LinkedMonitors` varchar(255), `Triggers` set('X10') NOT NULL default '', `EventStartCommand` VARCHAR(255) NOT NULL DEFAULT '', diff --git a/db/zm_update-1.37.22.sql b/db/zm_update-1.37.22.sql new file mode 100644 index 000000000..0a1c457dc --- /dev/null +++ b/db/zm_update-1.37.22.sql @@ -0,0 +1,18 @@ +-- +-- Update Monitors table to have a MQTT_Enabled Column +-- + +SELECT 'Checking for `Janus_RTSP_User` in Monitors'; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'Janus_RTSP_User' + ) > 0, +"SELECT 'Column Janus_RTSP_User already exists in Monitors'", +"ALTER TABLE Monitors ADD COLUMN `Janus_RTSP_User` INT(10) AFTER `Janus_Use_RTSP_Restream`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt;