From 7d685e96df1be6fa1355d22e080edeb6445502cb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 7 Jul 2024 09:03:31 -0400 Subject: [PATCH] Add db updates for WallClockTimestamps for 1.37.62 --- db/zm_create.sql.in | 1 + db/zm_update-1.37.62.sql | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 db/zm_update-1.37.62.sql diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index 1022afbca4..a71afe2c1e 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -559,6 +559,7 @@ CREATE TABLE `Monitors` ( `Encoder` varchar(32), `OutputContainer` enum('auto','mp4','mkv','webm'), `EncoderParameters` TEXT, + `WallClockTimestamps` TINYINT NOT NULL DEFAULT '0', `RecordAudio` TINYINT NOT NULL DEFAULT '0', `RecordingSource` enum('Primary','Secondary','Both') NOT NULL DEFAULT 'Primary', `RTSPDescribe` tinyint(1) unsigned, diff --git a/db/zm_update-1.37.62.sql b/db/zm_update-1.37.62.sql new file mode 100644 index 0000000000..3e3e9d9295 --- /dev/null +++ b/db/zm_update-1.37.62.sql @@ -0,0 +1,20 @@ +-- +-- Update Monitors table to have WallClockTimestamps +-- + +SELECT 'Checking for WallClockTImestamps in Monitors'; +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.COLUMNS + WHERE table_name = 'Monitors' + AND table_schema = DATABASE() + AND column_name = 'WallClockTimestamps' + ) > 0, +"SELECT 'Column WallClockTimestamps already exists on Monitors'", +"ALTER TABLE Monitors ADD `WallClockTimestamps` TINYINT NOT NULL DEFAULT '0' AFTER `EncoderParameters`" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +