Skip to content

Commit

Permalink
Add ServerId to Monitors
Browse files Browse the repository at this point in the history
  • Loading branch information
connortechnology committed Jul 2, 2015
1 parent 09b0520 commit 6d33da6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/zm_create.sql.in
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ DROP TABLE IF EXISTS `Monitors`;
CREATE TABLE `Monitors` (
`Id` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(64) NOT NULL default '',
`ServerId` int(10) unsigned,
`Type` enum('Local','Remote','File','Ffmpeg','Libvlc','cURL') NOT NULL default 'Local',
`Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor',
`Enabled` tinyint(3) unsigned NOT NULL default '1',
Expand Down
19 changes: 19 additions & 0 deletions db/zm_update-1.28.99.sql
Original file line number Diff line number Diff line change
Expand Up @@ -356,3 +356,22 @@ SET @s = (SELECT IF(
PRIMARY KEY (`Id`)
)"
));

--
-- Add ServerId column to Monitors
--

SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Monitors'
AND table_schema = DATABASE()
AND column_name = 'ServerId'
) > 0,
"SELECT 'Column ServerId exists in Monitors'",
"ALTER TABLE Monitors ADD `ServerId` int(10) unsigned AFTER `Name`"
));

PREPARE stmt FROM @s;
EXECUTE stmt;

0 comments on commit 6d33da6

Please sign in to comment.