2013-11-07 22:29:02 +08:00
|
|
|
--
|
|
|
|
-- This updates a 1.26.4 database to 1.26.5
|
|
|
|
--
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Add AlarmRefBlendPerc field for controlling the reference image blend percent during alarm (see pull request #241)
|
|
|
|
--
|
2013-12-30 22:32:20 +08:00
|
|
|
|
|
|
|
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",
|
2014-01-05 14:59:09 +08:00
|
|
|
"ALTER TABLE `Monitors` ADD `AlarmRefBlendPerc` TINYINT(3) UNSIGNED NOT NULL DEFAULT '6' AFTER `RefBlendPerc`"
|
2013-12-30 22:32:20 +08:00
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|
|
|
|
|
2014-01-05 14:59:09 +08:00
|
|
|
UPDATE `Monitors` SET `AlarmRefBlendPerc` = `RefBlendPerc`;
|
|
|
|
|
2013-11-07 22:29:02 +08:00
|
|
|
|