Merge pull request #1116 from ZoneMinder/add-index-to-frames

Add index to frames
This commit is contained in:
Andrew Bauer 2015-10-22 13:28:04 -05:00
commit 5608884bfa
5 changed files with 26 additions and 3 deletions

View File

@ -4,7 +4,7 @@
#
cmake_minimum_required (VERSION 2.6)
project (zoneminder)
set(zoneminder_VERSION "1.28.107")
set(zoneminder_VERSION "1.28.108")
# make API version a minor of ZM version
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")

View File

@ -3,7 +3,7 @@
# For instructions on building with cmake, please see INSTALL
#
AC_PREREQ(2.59)
AC_INIT(zm,1.28.107,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AC_INIT(zm,1.28.108,[http://www.zoneminder.com/forums/ - Please check FAQ first],zoneminder,http://www.zoneminder.com/downloads.html)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR(src/zm.h)
AC_CONFIG_HEADERS(config.h)

View File

@ -244,6 +244,7 @@ CREATE TABLE `Frames` (
`Delta` decimal(8,2) NOT NULL default '0.00',
`Score` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY (`Id`),
INDEX `EventId_idx` (`EventId`),
KEY `Type` (`Type`),
KEY `TimeStamp` (`TimeStamp`)
) ENGINE=@ZM_MYSQL_ENGINE@;

22
db/zm_update-1.28.108.sql Normal file
View File

@ -0,0 +1,22 @@
--
-- This updates a 1.28.107 database to 1.28.108
--
--
-- Update Frame table to have an Index on EventId, per the change made in 1.28.107
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.STATISTICS
WHERE table_name = 'Frames'
AND table_schema = DATABASE()
AND index_name='EventId_idx';
) > 0,
"SELECT 'EventId Index already exists on Frames table'",
"CREATE INDEX `EventId_idx` ON `Frames` (`EventId`)"
));
PREPARE stmt FROM @s;
EXECUTE stmt;

View File

@ -1 +1 @@
1.28.107
1.28.108