Merge pull request #1116 from ZoneMinder/add-index-to-frames
Add index to frames
This commit is contained in:
commit
5608884bfa
|
@ -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")
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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@;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue