diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 0ad1b2c0b..1022afbca 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -1218,13 +1218,13 @@ CREATE TABLE Snapshots ( PRIMARY KEY(Id) ) ENGINE=@ZM_MYSQL_ENGINE@; -CREATE TABLE Snapshot_Events ( +CREATE TABLE Snapshots_Events ( `Id` int(10) unsigned NOT NULL auto_increment, `SnapshotId` int(10) unsigned NOT NULL, FOREIGN KEY (`SnapshotId`) REFERENCES `Snapshots` (`Id`) ON DELETE CASCADE, `EventId` bigint unsigned NOT NULL, FOREIGN KEY (`EventId`) REFERENCES `Events` (`Id`) ON DELETE CASCADE, - KEY `Snapshot_Events_SnapshotId_idx` (`SnapshotId`), + KEY `Snapshots_Events_SnapshotId_idx` (`SnapshotId`), PRIMARY KEY(Id) ) ENGINE=@ZM_MYSQL_ENGINE@; diff --git a/db/zm_update-1.37.59.sql b/db/zm_update-1.37.59.sql new file mode 100644 index 000000000..7641640a0 --- /dev/null +++ b/db/zm_update-1.37.59.sql @@ -0,0 +1,17 @@ +-- +-- Rename Snapshot_Events to Snapshots_Events if it exists +-- + +SELECT 'Checking For Snapshot_Events Table which should be Snapshots_Events'; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'Snapshot_Events' + AND table_schema = DATABASE() + ) > 0, +"ALTER TABLE Snapshot_Events RENAME TO Snapshots_Events", +"SELECT 'Snapshot_Event table does not exist, good.'" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; diff --git a/distros/redhat/zoneminder.spec b/distros/redhat/zoneminder.spec index e8b6e1ccf..4c50f41d8 100644 --- a/distros/redhat/zoneminder.spec +++ b/distros/redhat/zoneminder.spec @@ -18,7 +18,7 @@ %global zmtargetdistro %{?rhel:el%{rhel}}%{!?rhel:fc%{fedora}} Name: zoneminder -Version: 1.37.58 +Version: 1.37.59 Release: 2%{?dist} Summary: A camera monitoring and analysis tool Group: System Environment/Daemons diff --git a/version.txt b/version.txt index 95fc26c1e..0acc7c08b 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.37.58 +1.37.59