Add SectionLengthWarn to Monitors table

pull/3644/merge
Isaac Connor 2023-01-07 12:34:30 -05:00
parent f06e11a097
commit 7a122f7367
2 changed files with 19 additions and 0 deletions

View File

@ -568,6 +568,7 @@ CREATE TABLE `Monitors` (
`StreamReplayBuffer` int(10) unsigned NOT NULL default '0',
`AlarmFrameCount` smallint(5) unsigned NOT NULL default '1',
`SectionLength` int(10) unsigned NOT NULL default '600',
`SectionLengthWarn` boolean NOT NULL default true,
`MinSectionLength` int(10) unsigned NOT NULL default '10',
`FrameSkip` smallint(5) unsigned NOT NULL default '0',
`MotionFrameSkip` smallint(5) unsigned NOT NULL default '0',

18
db/zm_update-1.37.29.sql Normal file
View File

@ -0,0 +1,18 @@
--
-- Update Monitors table to have SectionLengthWarn
--
SELECT 'Checking for SectionLengthWarn in Monitors';
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'SectionLengthWarn'
) > 0,
"SELECT 'Column SectionLengthWarn already exists in Monitors'",
"ALTER TABLE `Monitors` ADD COLUMN `SectionLengthWarn` boolean NOT NULL default true AFTER `SectionLength`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;