diff --git a/db/zm_update-1.26.5.sql b/db/zm_update-1.26.5.sql index 01308aae4..7c70d85b7 100644 --- a/db/zm_update-1.26.5.sql +++ b/db/zm_update-1.26.5.sql @@ -5,5 +5,19 @@ -- -- Add AlarmRefBlendPerc field for controlling the reference image blend percent during alarm (see pull request #241) -- -ALTER TABLE `Monitors` ADD `AlarmRefBlendPerc` TINYINT(3) UNSIGNED NOT NULL DEFAULT '3' AFTER `RefBlendPerc`; + +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'AlarmRefBlendPerc' + ) > 0, +"SELECT 1", +"ALTER TABLE `Monitors` ADD `AlarmRefBlendPerc` TINYINT(3) UNSIGNED NOT NULL DEFAULT '3' AFTER `RefBlendPerc`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + diff --git a/distros/debian/postinst b/distros/debian/postinst index 716c475e6..32e8d7a96 100644 --- a/distros/debian/postinst +++ b/distros/debian/postinst @@ -2,7 +2,7 @@ set -e -VERSION=1.26.4 +VERSION=1.26.5 if [ "$1" = "configure" ]; then # diff --git a/distros/debian/rules b/distros/debian/rules index 3dea63174..3a6840e7f 100755 --- a/distros/debian/rules +++ b/distros/debian/rules @@ -43,7 +43,7 @@ override_dh_clean: override_dh_install: # Add here commands to install the package into debian/zm. - $(MAKE) install DESTDIR=$(CURDIR)/debian/zoneminder RUNDIR=$(CURDIR)/debian/zoneminder/var/run ZM_RUNDIR=$(CURDIR)/debian/zoneminder/var/run + $(MAKE) install DESTDIR=$(CURDIR)/debian/zoneminder install -D -m 0644 db/zm_create.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db install -D -m 0644 db/zm_update-*.sql $(CURDIR)/debian/zoneminder/usr/share/zoneminder/db install -D -m 0644 debian/apache.conf $(CURDIR)/debian/zoneminder/etc/zm