2021-12-29 01:30:16 +08:00
|
|
|
/* Change Cause from varchar(32) to TEXT. We now include alarmed zone name */
|
|
|
|
ALTER TABLE `Events` MODIFY `Cause` TEXT;
|
2022-01-05 01:58:19 +08:00
|
|
|
|
|
|
|
--
|
|
|
|
-- Update Monitors table to have a ONVIF_Event_Listener Column
|
|
|
|
--
|
|
|
|
|
|
|
|
SELECT 'Checking for ONVIF_Event_Listener in Monitors';
|
|
|
|
SET @s = (SELECT IF(
|
|
|
|
(SELECT COUNT(*)
|
|
|
|
FROM INFORMATION_SCHEMA.COLUMNS
|
|
|
|
WHERE table_name = 'Monitors'
|
|
|
|
AND table_schema = DATABASE()
|
|
|
|
AND column_name = 'ONVIF_Event_Listener'
|
|
|
|
) > 0,
|
2022-01-10 22:07:59 +08:00
|
|
|
"SELECT 'Column ONVIF_Event_Listener already exists in Monitors'",
|
2022-01-05 01:58:19 +08:00
|
|
|
"ALTER TABLE `Monitors` ADD COLUMN `ONVIF_Event_Listener` BOOLEAN NOT NULL default false AFTER `ONVIF_Options`"
|
|
|
|
));
|
|
|
|
|
|
|
|
PREPARE stmt FROM @s;
|
|
|
|
EXECUTE stmt;
|