From 2f0abc983318473520ae5a646c2d532ed62f80c1 Mon Sep 17 00:00:00 2001 From: stan Date: Thu, 9 Nov 2006 11:50:52 +0000 Subject: [PATCH] Bug 382 - Added Devices tables to database git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2049 e3e1d417-86f3-4887-817a-d78f3d33393f --- db/zm_update-1.22.2.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/db/zm_update-1.22.2.sql b/db/zm_update-1.22.2.sql index 79667f54a..5d5197046 100644 --- a/db/zm_update-1.22.2.sql +++ b/db/zm_update-1.22.2.sql @@ -17,6 +17,13 @@ update Filters set Background = 1 where (AutoArchive = 1 or AutoVideo = 1 or Aut -- alter table Monitors add column DefaultView enum ('Events','Control') not null default 'Events' after ReturnDelay; +-- +-- Add device permissions column into Users, set the permissions for existing users to +-- be the same as for Monitors as a default +-- +alter table Users add column Devices enum('None','View','Edit') NOT NULL default 'None' after Monitors; +update Users set Devices = Monitors; + -- -- Create new preset labels table -- @@ -27,6 +34,18 @@ CREATE TABLE `ControlPresets` ( PRIMARY KEY (`MonitorId`,`Preset`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; +-- +-- Create new devices table +-- +CREATE TABLE `Devices` ( + `Id` int(10) unsigned NOT NULL auto_increment, + `Name` tinytext NOT NULL, + `Type` enum('X10') NOT NULL default 'X10', + `KeyString` varchar(32) NOT NULL default '', + PRIMARY KEY (`Id`), + UNIQUE KEY `UC_Id` (`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + -- -- These are optional, but we might as well do it now --