diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 3a5d45002..5a3d5e71b 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -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', diff --git a/db/zm_update-1.37.29.sql b/db/zm_update-1.37.29.sql new file mode 100644 index 000000000..ca83abf4d --- /dev/null +++ b/db/zm_update-1.37.29.sql @@ -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;