diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 4dfe2018c..51c67e150 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -204,8 +204,7 @@ CREATE TABLE `Events` ( `Executed` tinyint(3) unsigned NOT NULL default '0', `LearnState` char(1) default '', `Notes` text, - PRIMARY KEY (`Id`), - KEY `Id` (`Id`,`MonitorId`), + PRIMARY KEY (`Id`,`MonitorId`), KEY `MonitorId` (`MonitorId`), KEY `StartTime` (`StartTime`), KEY `Frames` (`Frames`), diff --git a/db/zm_update-1.22.3.sql b/db/zm_update-1.22.3.sql index 5bacc552f..6901d6821 100644 --- a/db/zm_update-1.22.3.sql +++ b/db/zm_update-1.22.3.sql @@ -52,6 +52,9 @@ alter table Frames drop index `UC_Id`; alter table Users drop index `UC_Id`; alter table ZonePresets drop index `UC_Id`; alter table Zones drop index `UC_Id`; +alter table Events drop primary key; +alter table Events add primary key ( `Id`, `MonitorId` ); +alter table Events drop index `Id`; -- -- These are optional, but we might as well do it now