Updates for version 1.24.4
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3358 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
7b43ac2645
commit
58c77d2b40
|
@ -1,5 +1,5 @@
|
|||
AC_PREREQ(2.59)
|
||||
AC_INIT(zm,1.24.3,support@zoneminder.com,ZoneMinder,http://www.zoneminder.com/downloads.html)
|
||||
AC_INIT(zm,1.24.4,support@zoneminder.com,ZoneMinder,http://www.zoneminder.com/downloads.html)
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_CONFIG_SRCDIR(src/zm.h)
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
|
|
@ -39,4 +39,5 @@ EXTRA_DIST = \
|
|||
zm_update-1.23.3.sql \
|
||||
zm_update-1.24.0.sql \
|
||||
zm_update-1.24.1.sql \
|
||||
zm_update-1.24.2.sql
|
||||
zm_update-1.24.2.sql \
|
||||
zm_update-1.24.3.sql
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
--
|
||||
-- This updates a 1.24.3 database to the next version
|
||||
--
|
||||
|
||||
--
|
||||
-- These are optional, but we might as well do it now
|
||||
--
|
||||
optimize table Frames;
|
||||
optimize table Events;
|
||||
optimize table Filters;
|
||||
optimize table Zones;
|
||||
optimize table Monitors;
|
||||
optimize table Stats;
|
|
@ -901,6 +901,41 @@ if ( $version )
|
|||
patchDB( $dbh, "1.24.2" );
|
||||
$cascade = !undef;
|
||||
}
|
||||
if ( $cascade || $version eq "1.24.3" )
|
||||
{
|
||||
my $result = eval
|
||||
{
|
||||
require PHP::Serialization;
|
||||
PHP::Serialization->import();
|
||||
};
|
||||
die( "Unable to perform upgrade from 1.24.3, PHP::Serialization module not found" ) if ( $result );
|
||||
|
||||
# Patch the database
|
||||
patchDB( $dbh, "1.24.3" );
|
||||
|
||||
# Convert filters to JSON from PHP format serialisation
|
||||
{
|
||||
my $sql = "select * from Filters";
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute() or die( "Can't execute: ".$sth->errstr() );
|
||||
my @dbFilters;
|
||||
while( my $dbFilter = $sth->fetchrow_hashref() )
|
||||
{
|
||||
push( @dbFilters, $dbFilter );
|
||||
}
|
||||
$sth->finish();
|
||||
foreach my $dbFilter ( @dbFilters )
|
||||
{
|
||||
my $phpQuery = $dbFilter->{Query};
|
||||
my $query = PHP::Serialization::unserialize( $phpQuery );
|
||||
my $jsonQuery = jsonEncode( $query );
|
||||
my $sql = "update Filters set Query = ? where Name = ?";
|
||||
my $sth = $dbh->prepare_cached( $sql ) or die( "Can't prepare '$sql': ".$dbh->errstr() );
|
||||
my $res = $sth->execute( $jsonQuery, $dbFilter->{Name} ) or die( "Can't execute: ".$sth->errstr() );
|
||||
}
|
||||
}
|
||||
$cascade = !undef;
|
||||
}
|
||||
if ( $cascade )
|
||||
{
|
||||
my $installed_version = ZM_VERSION;
|
||||
|
|
Loading…
Reference in New Issue