diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 4acc281c4..d755b6a67 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -65,7 +65,7 @@ DROP TABLE IF EXISTS `Controls`; CREATE TABLE `Controls` ( `Id` int(10) unsigned NOT NULL auto_increment, `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `Protocol` varchar(64) default NULL, `CanWake` tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0', @@ -612,7 +612,7 @@ CREATE TABLE `MonitorPresets` ( `Id` int(10) unsigned NOT NULL auto_increment, `ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id), `Name` varchar(64) NOT NULL default '', - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `Device` tinytext, `Channel` tinyint(3) unsigned default NULL, `Format` int(10) unsigned default NULL, @@ -649,7 +649,7 @@ CREATE TABLE `Monitors` ( `StorageId` smallint(5) unsigned default 0, `ManufacturerId` int unsigned, FOREIGN KEY (`ManufacturerId`) REFERENCES `Manufacturers` (Id), `ModelId` int unsigned, FOREIGN KEY (`ModelId`) REFERENCES `Models` (Id), - `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','NVSocket','VNC') NOT NULL default 'Local', + `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local', `DeviceClass` enum('Camera','Speaker') NOT NULL default 'Camera', `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', `Capturing` enum('None','Ondemand', 'Always') NOT NULL default 'Always', diff --git a/db/zm_update-1.39.38.sql b/db/zm_update-1.39.38.sql new file mode 100644 index 000000000..c06157d38 --- /dev/null +++ b/db/zm_update-1.39.38.sql @@ -0,0 +1,39 @@ +-- +-- This updates a 1.39.37 database to 1.39.38 +-- +-- Move monitors off capture methods that are going away. +-- +-- NVSocket is removed in this release and Libvlc is deprecated. Both reach +-- cameras that ffmpeg reaches, so the monitors are converted rather than +-- left to fail. +-- + +-- +-- Libvlc becomes Ffmpeg. Path already holds the full url for this type, and +-- User and Pass are merged the same way, so only the type changes. +-- +UPDATE `Monitors` SET `Type` = 'Ffmpeg' WHERE `Type` = 'Libvlc'; + +-- +-- NVSocket has no url to convert: it spoke a bespoke socket protocol to one +-- vendor's nvr. There is nothing to point ffmpeg at, so the monitor is +-- disabled instead of being left with a type the daemon no longer knows -- +-- an unrecognised type is Fatal, which would take zmc down rather than skip +-- the monitor. The row is kept so its zones, groups and history survive for +-- whoever has to decide what to do with it. +-- +UPDATE `Monitors` SET `Type` = 'Ffmpeg', `Capturing` = 'None' WHERE `Type` = 'NVSocket'; +UPDATE `Controls` SET `Type` = 'Ffmpeg' WHERE `Type` = 'NVSocket'; +UPDATE `MonitorPresets` SET `Type` = 'Ffmpeg' WHERE `Type` = 'NVSocket'; + +-- +-- Now that no row uses it, drop the value from the three enums that carry it. +-- Libvlc stays: it is deprecated, not removed, and a monitor can still be set +-- to it by hand. +-- +ALTER TABLE `Monitors` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; +ALTER TABLE `MonitorPresets` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; +ALTER TABLE `Controls` + MODIFY `Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL','WebSite','VNC') NOT NULL default 'Local'; diff --git a/version.txt b/version.txt index 5685d9c56..1c410917f 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.39.37 +1.39.38