Add StartupDelay to Monitors
parent
ebcc2cd045
commit
1d7efa7088
|
@ -617,6 +617,7 @@ CREATE TABLE `Monitors` (
|
|||
`Importance` enum('Normal','Less','Not') NOT NULL default 'Normal',
|
||||
`MQTT_Enabled` BOOLEAN NOT NULL DEFAULT false,
|
||||
`MQTT_Subscriptions` varchar(255) default '',
|
||||
`StartupDelay` INT NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`Id`)
|
||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
--
|
||||
-- Update Monitors table to have StartupDelay
|
||||
--
|
||||
|
||||
SELECT 'Checking for StartupDelay in Monitors';
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Monitors'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'StartupDelay'
|
||||
) > 0,
|
||||
"SELECT 'Column StartupDelay already exists on Monitors'",
|
||||
"ALTER TABLE Monitors ADD `StartupDelay` INT NOT NULL DEFAULT 0 AFTER `MQTT_Subscriptions`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
Loading…
Reference in New Issue