From cae37e29b0c02f8116311c396d0c4ee4c4eb4755 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 15 Dec 2017 15:17:49 -0500 Subject: [PATCH] alter Events Primary Key to just the Id. This prevents a double key index on MonitorId --- db/zm_create.sql.in | 2 +- db/zm_update-1.31.17.sql | 5 +++++ version | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 db/zm_update-1.31.17.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index ec035d227..993b65824 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -209,7 +209,7 @@ CREATE TABLE `Events` ( `StateId` int(10) unsigned NOT NULL, `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0', `DiskSpace` bigint unsigned default NULL, - PRIMARY KEY (`Id`,`MonitorId`), + PRIMARY KEY (`Id`), KEY `MonitorId` (`MonitorId`), KEY `StartTime` (`StartTime`), KEY `Frames` (`Frames`), diff --git a/db/zm_update-1.31.17.sql b/db/zm_update-1.31.17.sql new file mode 100644 index 000000000..d0b55f334 --- /dev/null +++ b/db/zm_update-1.31.17.sql @@ -0,0 +1,5 @@ +alter table Events modify Id int(10) unsigned; +alter table Events DROP Primary key; +alter table Events Add Primary key(Id); +alter table Events modify Id int(10) unsigned auto_incremement; + diff --git a/version b/version index d1a8f5341..874058d96 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.16 +1.31.17