Updated with 1.22.3 db structure.

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2073 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2006-11-16 19:16:19 +00:00
parent d2c979f0bb
commit 6572552b94
1 changed files with 429 additions and 358 deletions

View File

@ -1,436 +1,507 @@
-- MySQL dump 10.9
-- --
-- Current Database: @ZM_DB_NAME@ -- Host: localhost Database: @ZM_DB_NAME@
-- ------------------------------------------------------
-- Server version 4.1.16-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Current Database: `@ZM_DB_NAME@`
-- --
CREATE DATABASE /*!32312 IF NOT EXISTS*/ @ZM_DB_NAME@; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `@ZM_DB_NAME@` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE @ZM_DB_NAME@; USE `@ZM_DB_NAME@`;
-- --
-- Table structure for table `Config` -- Table structure for table `Config`
-- --
CREATE TABLE Config ( DROP TABLE IF EXISTS `Config`;
Id smallint(5) unsigned NOT NULL default '0', CREATE TABLE `Config` (
Name varchar(32) NOT NULL default '', `Id` smallint(5) unsigned NOT NULL default '0',
Value text NOT NULL, `Name` varchar(32) NOT NULL default '',
Type tinytext NOT NULL, `Value` text NOT NULL,
DefaultValue tinytext, `Type` tinytext NOT NULL,
Hint tinytext, `DefaultValue` tinytext,
Pattern tinytext, `Hint` tinytext,
Format tinytext, `Pattern` tinytext,
Prompt tinytext, `Format` tinytext,
Help text, `Prompt` tinytext,
Category varchar(32) NOT NULL default '', `Help` text,
Readonly tinyint(3) unsigned NOT NULL default '0', `Category` varchar(32) NOT NULL default '',
Requires text, `Readonly` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (Name), `Requires` text,
UNIQUE KEY UC_Name (Name) PRIMARY KEY (`Name`),
) TYPE=MyISAM; UNIQUE KEY `UC_Name` (`Name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `ControlPresets`
--
DROP TABLE IF EXISTS `ControlPresets`;
CREATE TABLE `ControlPresets` (
`MonitorId` int(10) unsigned NOT NULL default '0',
`Preset` int(10) unsigned NOT NULL default '0',
`Label` varchar(64) NOT NULL default '',
PRIMARY KEY (`MonitorId`,`Preset`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Controls` -- Table structure for table `Controls`
-- --
CREATE TABLE Controls ( DROP TABLE IF EXISTS `Controls`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Controls` (
Name varchar(64) NOT NULL default '', `Id` int(10) unsigned NOT NULL auto_increment,
Type enum('Local','Remote') NOT NULL default 'Local', `Name` varchar(64) NOT NULL default '',
Command varchar(255) default NULL, `Type` enum('Local','Remote') NOT NULL default 'Local',
CanWake tinyint(3) unsigned NOT NULL default '0', `Command` varchar(255) default NULL,
CanSleep tinyint(3) unsigned NOT NULL default '0', `Protocol` varchar(32) default NULL,
CanReset tinyint(3) unsigned NOT NULL default '0', `CanWake` tinyint(3) unsigned NOT NULL default '0',
CanZoom tinyint(3) unsigned NOT NULL default '0', `CanSleep` tinyint(3) unsigned NOT NULL default '0',
CanAutoZoom tinyint(3) unsigned NOT NULL default '0', `CanReset` tinyint(3) unsigned NOT NULL default '0',
CanZoomAbs tinyint(3) unsigned NOT NULL default '0', `CanZoom` tinyint(3) unsigned NOT NULL default '0',
CanZoomRel tinyint(3) unsigned NOT NULL default '0', `CanAutoZoom` tinyint(3) unsigned NOT NULL default '0',
CanZoomCon tinyint(3) unsigned NOT NULL default '0', `CanZoomAbs` tinyint(3) unsigned NOT NULL default '0',
MinZoomRange int(10) unsigned default NULL, `CanZoomRel` tinyint(3) unsigned NOT NULL default '0',
MaxZoomRange int(10) unsigned default NULL, `CanZoomCon` tinyint(3) unsigned NOT NULL default '0',
MinZoomStep int(10) unsigned default NULL, `MinZoomRange` int(10) unsigned default NULL,
MaxZoomStep int(10) unsigned default NULL, `MaxZoomRange` int(10) unsigned default NULL,
HasZoomSpeed tinyint(3) unsigned NOT NULL default '0', `MinZoomStep` int(10) unsigned default NULL,
MinZoomSpeed int(10) unsigned default NULL, `MaxZoomStep` int(10) unsigned default NULL,
MaxZoomSpeed int(10) unsigned default NULL, `HasZoomSpeed` tinyint(3) unsigned NOT NULL default '0',
CanFocus tinyint(3) unsigned NOT NULL default '0', `MinZoomSpeed` int(10) unsigned default NULL,
CanAutoFocus tinyint(3) unsigned NOT NULL default '0', `MaxZoomSpeed` int(10) unsigned default NULL,
CanFocusAbs tinyint(3) unsigned NOT NULL default '0', `CanFocus` tinyint(3) unsigned NOT NULL default '0',
CanFocusRel tinyint(3) unsigned NOT NULL default '0', `CanAutoFocus` tinyint(3) unsigned NOT NULL default '0',
CanFocusCon tinyint(3) unsigned NOT NULL default '0', `CanFocusAbs` tinyint(3) unsigned NOT NULL default '0',
MinFocusRange int(10) unsigned default NULL, `CanFocusRel` tinyint(3) unsigned NOT NULL default '0',
MaxFocusRange int(10) unsigned default NULL, `CanFocusCon` tinyint(3) unsigned NOT NULL default '0',
MinFocusStep int(10) unsigned default NULL, `MinFocusRange` int(10) unsigned default NULL,
MaxFocusStep int(10) unsigned default NULL, `MaxFocusRange` int(10) unsigned default NULL,
HasFocusSpeed tinyint(3) unsigned NOT NULL default '0', `MinFocusStep` int(10) unsigned default NULL,
MinFocusSpeed int(10) unsigned default NULL, `MaxFocusStep` int(10) unsigned default NULL,
MaxFocusSpeed int(10) unsigned default NULL, `HasFocusSpeed` tinyint(3) unsigned NOT NULL default '0',
CanIris tinyint(3) unsigned NOT NULL default '0', `MinFocusSpeed` int(10) unsigned default NULL,
CanAutoIris tinyint(3) unsigned NOT NULL default '0', `MaxFocusSpeed` int(10) unsigned default NULL,
CanIrisAbs tinyint(3) unsigned NOT NULL default '0', `CanIris` tinyint(3) unsigned NOT NULL default '0',
CanIrisRel tinyint(3) unsigned NOT NULL default '0', `CanAutoIris` tinyint(3) unsigned NOT NULL default '0',
CanIrisCon tinyint(3) unsigned NOT NULL default '0', `CanIrisAbs` tinyint(3) unsigned NOT NULL default '0',
MinIrisRange int(10) unsigned default NULL, `CanIrisRel` tinyint(3) unsigned NOT NULL default '0',
MaxIrisRange int(10) unsigned default NULL, `CanIrisCon` tinyint(3) unsigned NOT NULL default '0',
MinIrisStep int(10) unsigned default NULL, `MinIrisRange` int(10) unsigned default NULL,
MaxIrisStep int(10) unsigned default NULL, `MaxIrisRange` int(10) unsigned default NULL,
HasIrisSpeed tinyint(3) unsigned NOT NULL default '0', `MinIrisStep` int(10) unsigned default NULL,
MinIrisSpeed int(10) unsigned default NULL, `MaxIrisStep` int(10) unsigned default NULL,
MaxIrisSpeed int(10) unsigned default NULL, `HasIrisSpeed` tinyint(3) unsigned NOT NULL default '0',
CanGain tinyint(3) unsigned NOT NULL default '0', `MinIrisSpeed` int(10) unsigned default NULL,
CanAutoGain tinyint(3) unsigned NOT NULL default '0', `MaxIrisSpeed` int(10) unsigned default NULL,
CanGainAbs tinyint(3) unsigned NOT NULL default '0', `CanGain` tinyint(3) unsigned NOT NULL default '0',
CanGainRel tinyint(3) unsigned NOT NULL default '0', `CanAutoGain` tinyint(3) unsigned NOT NULL default '0',
CanGainCon tinyint(3) unsigned NOT NULL default '0', `CanGainAbs` tinyint(3) unsigned NOT NULL default '0',
MinGainRange int(10) unsigned default NULL, `CanGainRel` tinyint(3) unsigned NOT NULL default '0',
MaxGainRange int(10) unsigned default NULL, `CanGainCon` tinyint(3) unsigned NOT NULL default '0',
MinGainStep int(10) unsigned default NULL, `MinGainRange` int(10) unsigned default NULL,
MaxGainStep int(10) unsigned default NULL, `MaxGainRange` int(10) unsigned default NULL,
HasGainSpeed tinyint(3) unsigned NOT NULL default '0', `MinGainStep` int(10) unsigned default NULL,
MinGainSpeed int(10) unsigned default NULL, `MaxGainStep` int(10) unsigned default NULL,
MaxGainSpeed int(10) unsigned default NULL, `HasGainSpeed` tinyint(3) unsigned NOT NULL default '0',
CanWhite tinyint(3) unsigned NOT NULL default '0', `MinGainSpeed` int(10) unsigned default NULL,
CanAutoWhite tinyint(3) unsigned NOT NULL default '0', `MaxGainSpeed` int(10) unsigned default NULL,
CanWhiteAbs tinyint(3) unsigned NOT NULL default '0', `CanWhite` tinyint(3) unsigned NOT NULL default '0',
CanWhiteRel tinyint(3) unsigned NOT NULL default '0', `CanAutoWhite` tinyint(3) unsigned NOT NULL default '0',
CanWhiteCon tinyint(3) unsigned NOT NULL default '0', `CanWhiteAbs` tinyint(3) unsigned NOT NULL default '0',
MinWhiteRange int(10) unsigned default NULL, `CanWhiteRel` tinyint(3) unsigned NOT NULL default '0',
MaxWhiteRange int(10) unsigned default NULL, `CanWhiteCon` tinyint(3) unsigned NOT NULL default '0',
MinWhiteStep int(10) unsigned default NULL, `MinWhiteRange` int(10) unsigned default NULL,
MaxWhiteStep int(10) unsigned default NULL, `MaxWhiteRange` int(10) unsigned default NULL,
HasWhiteSpeed tinyint(3) unsigned NOT NULL default '0', `MinWhiteStep` int(10) unsigned default NULL,
MinWhiteSpeed int(10) unsigned default NULL, `MaxWhiteStep` int(10) unsigned default NULL,
MaxWhiteSpeed int(10) unsigned default NULL, `HasWhiteSpeed` tinyint(3) unsigned NOT NULL default '0',
HasPresets tinyint(3) unsigned NOT NULL default '0', `MinWhiteSpeed` int(10) unsigned default NULL,
NumPresets tinyint(3) unsigned NOT NULL default '0', `MaxWhiteSpeed` int(10) unsigned default NULL,
HasHomePreset tinyint(3) unsigned NOT NULL default '0', `HasPresets` tinyint(3) unsigned NOT NULL default '0',
CanSetPresets tinyint(3) unsigned NOT NULL default '0', `NumPresets` tinyint(3) unsigned NOT NULL default '0',
CanMove tinyint(3) unsigned NOT NULL default '0', `HasHomePreset` tinyint(3) unsigned NOT NULL default '0',
CanMoveDiag tinyint(3) unsigned NOT NULL default '0', `CanSetPresets` tinyint(3) unsigned NOT NULL default '0',
CanMoveMap tinyint(3) unsigned NOT NULL default '0', `CanMove` tinyint(3) unsigned NOT NULL default '0',
CanMoveAbs tinyint(3) unsigned NOT NULL default '0', `CanMoveDiag` tinyint(3) unsigned NOT NULL default '0',
CanMoveRel tinyint(3) unsigned NOT NULL default '0', `CanMoveMap` tinyint(3) unsigned NOT NULL default '0',
CanMoveCon tinyint(3) unsigned NOT NULL default '0', `CanMoveAbs` tinyint(3) unsigned NOT NULL default '0',
CanPan tinyint(3) unsigned NOT NULL default '0', `CanMoveRel` tinyint(3) unsigned NOT NULL default '0',
MinPanRange int(10) default NULL, `CanMoveCon` tinyint(3) unsigned NOT NULL default '0',
MaxPanRange int(10) default NULL, `CanPan` tinyint(3) unsigned NOT NULL default '0',
MinPanStep int(10) default NULL, `MinPanRange` int(10) default NULL,
MaxPanStep int(10) default NULL, `MaxPanRange` int(10) default NULL,
HasPanSpeed tinyint(3) unsigned NOT NULL default '0', `MinPanStep` int(10) default NULL,
MinPanSpeed int(10) default NULL, `MaxPanStep` int(10) default NULL,
MaxPanSpeed int(10) default NULL, `HasPanSpeed` tinyint(3) unsigned NOT NULL default '0',
HasTurboPan tinyint(3) unsigned NOT NULL default '0', `MinPanSpeed` int(10) default NULL,
TurboPanSpeed int(10) default NULL, `MaxPanSpeed` int(10) default NULL,
CanTilt tinyint(3) unsigned NOT NULL default '0', `HasTurboPan` tinyint(3) unsigned NOT NULL default '0',
MinTiltRange int(10) default NULL, `TurboPanSpeed` int(10) default NULL,
MaxTiltRange int(10) default NULL, `CanTilt` tinyint(3) unsigned NOT NULL default '0',
MinTiltStep int(10) default NULL, `MinTiltRange` int(10) default NULL,
MaxTiltStep int(10) default NULL, `MaxTiltRange` int(10) default NULL,
HasTiltSpeed tinyint(3) unsigned NOT NULL default '0', `MinTiltStep` int(10) default NULL,
MinTiltSpeed int(10) default NULL, `MaxTiltStep` int(10) default NULL,
MaxTiltSpeed int(10) default NULL, `HasTiltSpeed` tinyint(3) unsigned NOT NULL default '0',
HasTurboTilt tinyint(3) unsigned NOT NULL default '0', `MinTiltSpeed` int(10) default NULL,
TurboTiltSpeed int(10) default NULL, `MaxTiltSpeed` int(10) default NULL,
CanAutoScan tinyint(3) unsigned NOT NULL default '0', `HasTurboTilt` tinyint(3) unsigned NOT NULL default '0',
NumScanPaths tinyint(3) unsigned NOT NULL default '0', `TurboTiltSpeed` int(10) default NULL,
PRIMARY KEY (Id), `CanAutoScan` tinyint(3) unsigned NOT NULL default '0',
UNIQUE KEY UC_Id (Id) `NumScanPaths` tinyint(3) unsigned NOT NULL default '0',
) TYPE=MyISAM; PRIMARY KEY (`Id`),
UNIQUE KEY `UC_Id` (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `Devices`
--
DROP TABLE IF EXISTS `Devices`;
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;
-- --
-- Table structure for table `Events` -- Table structure for table `Events`
-- --
CREATE TABLE Events ( DROP TABLE IF EXISTS `Events`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Events` (
MonitorId int(10) unsigned NOT NULL default '0', `Id` int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL default '', `MonitorId` int(10) unsigned NOT NULL default '0',
Cause varchar(32) NOT NULL default '', `Name` varchar(64) NOT NULL default '',
StartTime datetime default NULL, `Cause` varchar(32) NOT NULL default '',
EndTime datetime default NULL, `StartTime` datetime default NULL,
Width smallint(5) unsigned NOT NULL default '0', `EndTime` datetime default NULL,
Height smallint(5) unsigned NOT NULL default '0', `Width` smallint(5) unsigned NOT NULL default '0',
Length decimal(10,2) NOT NULL default '0.00', `Height` smallint(5) unsigned NOT NULL default '0',
Frames int(10) unsigned default NULL, `Length` decimal(10,2) NOT NULL default '0.00',
AlarmFrames int(10) unsigned default NULL, `Frames` int(10) unsigned default NULL,
TotScore int(10) unsigned NOT NULL default '0', `AlarmFrames` int(10) unsigned default NULL,
AvgScore smallint(5) unsigned default '0', `TotScore` int(10) unsigned NOT NULL default '0',
MaxScore smallint(5) unsigned default '0', `AvgScore` smallint(5) unsigned default '0',
Archived tinyint(3) unsigned NOT NULL default '0', `MaxScore` smallint(5) unsigned default '0',
Videoed tinyint(3) unsigned NOT NULL default '0', `Archived` tinyint(3) unsigned NOT NULL default '0',
Uploaded tinyint(3) unsigned NOT NULL default '0', `Videoed` tinyint(3) unsigned NOT NULL default '0',
Emailed tinyint(3) unsigned NOT NULL default '0', `Uploaded` tinyint(3) unsigned NOT NULL default '0',
Messaged tinyint(3) unsigned NOT NULL default '0', `Emailed` tinyint(3) unsigned NOT NULL default '0',
Executed tinyint(3) unsigned NOT NULL default '0', `Messaged` tinyint(3) unsigned NOT NULL default '0',
LearnState char(1) default '', `Executed` tinyint(3) unsigned NOT NULL default '0',
Notes text, `LearnState` char(1) default '',
PRIMARY KEY (Id), `Notes` text,
UNIQUE KEY UC_Id (Id), PRIMARY KEY (`Id`),
KEY Id (Id,MonitorId), UNIQUE KEY `UC_Id` (`Id`),
KEY MonitorId (MonitorId), KEY `Id` (`Id`,`MonitorId`),
KEY StartTime (StartTime), KEY `MonitorId` (`MonitorId`),
KEY Frames (Frames), KEY `StartTime` (`StartTime`),
KEY Archived (Archived) KEY `Frames` (`Frames`),
) TYPE=MyISAM; KEY `Archived` (`Archived`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Filters` -- Table structure for table `Filters`
-- --
CREATE TABLE Filters ( DROP TABLE IF EXISTS `Filters`;
Name varchar(64) NOT NULL default '', CREATE TABLE `Filters` (
Query text NOT NULL, `Name` varchar(64) NOT NULL default '',
AutoArchive tinyint(3) unsigned NOT NULL default '0', `Query` text NOT NULL,
AutoVideo tinyint(3) unsigned NOT NULL default '0', `AutoArchive` tinyint(3) unsigned NOT NULL default '0',
AutoUpload tinyint(3) unsigned NOT NULL default '0', `AutoVideo` tinyint(3) unsigned NOT NULL default '0',
AutoEmail tinyint(3) unsigned NOT NULL default '0', `AutoUpload` tinyint(3) unsigned NOT NULL default '0',
AutoMessage tinyint(3) unsigned NOT NULL default '0', `AutoEmail` tinyint(3) unsigned NOT NULL default '0',
AutoExecute tinyint(3) unsigned NOT NULL default '0', `AutoMessage` tinyint(3) unsigned NOT NULL default '0',
AutoExecuteCmd tinytext, `AutoExecute` tinyint(3) unsigned NOT NULL default '0',
AutoDelete tinyint(3) unsigned NOT NULL default '0', `AutoExecuteCmd` tinytext,
PRIMARY KEY (Name) `AutoDelete` tinyint(3) unsigned NOT NULL default '0',
) TYPE=MyISAM; `Background` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`Name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Frames` -- Table structure for table `Frames`
-- --
CREATE TABLE Frames ( DROP TABLE IF EXISTS `Frames`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Frames` (
EventId int(10) unsigned NOT NULL default '0', `Id` int(10) unsigned NOT NULL auto_increment,
FrameId int(10) unsigned NOT NULL default '0', `EventId` int(10) unsigned NOT NULL default '0',
Type enum('Normal','Bulk','Alarm') NOT NULL default 'Normal', `FrameId` int(10) unsigned NOT NULL default '0',
TimeStamp timestamp(14) NOT NULL, `Type` enum('Normal','Bulk','Alarm') NOT NULL default 'Normal',
Delta decimal(8,2) NOT NULL default '0.00', `TimeStamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
Score smallint(5) unsigned NOT NULL default '0', `Delta` decimal(8,2) NOT NULL default '0.00',
PRIMARY KEY (Id), `Score` smallint(5) unsigned NOT NULL default '0',
UNIQUE KEY UC_Id (Id), PRIMARY KEY (`Id`),
KEY EventId (EventId), UNIQUE KEY `UC_Id` (`Id`),
KEY Type (Type), KEY `EventId` (`EventId`),
KEY TimeStamp (TimeStamp) KEY `Type` (`Type`),
) TYPE=MyISAM; KEY `TimeStamp` (`TimeStamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Groups` -- Table structure for table `Groups`
-- --
CREATE TABLE Groups ( DROP TABLE IF EXISTS `Groups`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Groups` (
Name varchar(64) NOT NULL default '', `Id` int(10) unsigned NOT NULL auto_increment,
MonitorIds tinytext NOT NULL, `Name` varchar(64) NOT NULL default '',
PRIMARY KEY (Id) `MonitorIds` tinytext NOT NULL,
) TYPE=MyISAM; PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `MonitorPresets` -- Table structure for table `MonitorPresets`
-- --
DROP TABLE IF EXISTS `MonitorPresets`;
CREATE TABLE `MonitorPresets` ( CREATE TABLE `MonitorPresets` (
Id int(10) unsigned NOT NULL auto_increment, `Id` int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL, `Name` varchar(64) NOT NULL default '',
Type enum('Local','Remote','File') NOT NULL default 'Local', `Type` enum('Local','Remote','File') NOT NULL default 'Local',
Device tinytext, `Device` tinytext,
Channel varchar(32) default NULL, `Channel` varchar(32) default NULL,
Format varchar(32) default NULL, `Format` varchar(32) default NULL,
Host varchar(64) default NULL, `Host` varchar(64) default NULL,
Port varchar(8) default NULL, `Port` varchar(8) default NULL,
Path varchar(255) default NULL, `Path` varchar(255) default NULL,
Width smallint(5) unsigned default NULL, `Width` smallint(5) unsigned default NULL,
Height smallint(5) unsigned default NULL, `Height` smallint(5) unsigned default NULL,
Palette tinyint(3) unsigned default NULL, `Palette` tinyint(3) unsigned default NULL,
MaxFPS decimal(5,2) default NULL, `MaxFPS` decimal(5,2) default NULL,
Controllable tinyint(3) unsigned NOT NULL default '0', `Controllable` tinyint(3) unsigned NOT NULL default '0',
ControlId varchar(16) default NULL, `ControlId` varchar(16) default NULL,
ControlDevice varchar(255) default NULL, `ControlDevice` varchar(255) default NULL,
ControlAddress varchar(255) default NULL, `ControlAddress` varchar(255) default NULL,
DefaultRate smallint(5) unsigned NOT NULL default '100', `DefaultRate` smallint(5) unsigned NOT NULL default '100',
DefaultScale smallint(5) unsigned NOT NULL default '100', `DefaultScale` smallint(5) unsigned NOT NULL default '100',
PRIMARY KEY (Id) PRIMARY KEY (`Id`)
) TYPE=MyISAM; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Monitors` -- Table structure for table `Monitors`
-- --
CREATE TABLE Monitors ( DROP TABLE IF EXISTS `Monitors`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Monitors` (
Name varchar(64) NOT NULL default '', `Id` int(10) unsigned NOT NULL auto_increment,
Type enum('Local','Remote','File') NOT NULL default 'Local', `Name` varchar(64) NOT NULL default '',
Function enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor', `Type` enum('Local','Remote','File') NOT NULL default 'Local',
Enabled tinyint(3) unsigned NOT NULL default '1', `Function` enum('None','Monitor','Modect','Record','Mocord','Nodect') NOT NULL default 'Monitor',
LinkedMonitors varchar(255) NOT NULL default '', `Enabled` tinyint(3) unsigned NOT NULL default '1',
Triggers set('X10') NOT NULL default '', `LinkedMonitors` varchar(255) NOT NULL default '',
Device varchar(64) NOT NULL default '', `Triggers` set('X10') NOT NULL default '',
Channel tinyint(3) unsigned NOT NULL default '0', `Device` varchar(64) NOT NULL default '',
Format tinyint(3) unsigned NOT NULL default '0', `Channel` tinyint(3) unsigned NOT NULL default '0',
Host varchar(64) NOT NULL default '', `Format` tinyint(3) unsigned NOT NULL default '0',
Port varchar(8) NOT NULL default '', `Host` varchar(64) NOT NULL default '',
Path varchar(255) NOT NULL default '', `Port` varchar(8) NOT NULL default '',
Width smallint(5) unsigned NOT NULL default '0', `Path` varchar(255) NOT NULL default '',
Height smallint(5) unsigned NOT NULL default '0', `Width` smallint(5) unsigned NOT NULL default '0',
Palette tinyint(3) unsigned NOT NULL default '1', `Height` smallint(5) unsigned NOT NULL default '0',
Orientation enum('0','90','180','270','hori','vert') NOT NULL default '0', `Palette` tinyint(3) unsigned NOT NULL default '1',
Brightness mediumint(7) NOT NULL default '-1', `Orientation` enum('0','90','180','270','hori','vert') NOT NULL default '0',
Contrast mediumint(7) NOT NULL default '-1', `Brightness` mediumint(7) NOT NULL default '-1',
Hue mediumint(7) NOT NULL default '-1', `Contrast` mediumint(7) NOT NULL default '-1',
Colour mediumint(7) NOT NULL default '-1', `Hue` mediumint(7) NOT NULL default '-1',
EventPrefix varchar(32) NOT NULL default 'Event-', `Colour` mediumint(7) NOT NULL default '-1',
LabelFormat varchar(64) NOT NULL default '%%s - %y/%m/%d %H:%M:%S', `EventPrefix` varchar(32) NOT NULL default 'Event-',
LabelX smallint(5) unsigned NOT NULL default 0, `LabelFormat` varchar(64) NOT NULL default '%%s - %y/%m/%d %H:%M:%S',
LabelY smallint(5) unsigned NOT NULL default 0, `LabelX` smallint(5) unsigned NOT NULL default '0',
ImageBufferCount smallint(5) unsigned NOT NULL default '100', `LabelY` smallint(5) unsigned NOT NULL default '0',
WarmupCount smallint(5) unsigned NOT NULL default '25', `ImageBufferCount` smallint(5) unsigned NOT NULL default '100',
PreEventCount smallint(5) unsigned NOT NULL default '10', `WarmupCount` smallint(5) unsigned NOT NULL default '25',
PostEventCount smallint(5) unsigned NOT NULL default '10', `PreEventCount` smallint(5) unsigned NOT NULL default '10',
AlarmFrameCount smallint(5) unsigned NOT NULL default '1', `PostEventCount` smallint(5) unsigned NOT NULL default '10',
SectionLength int(10) unsigned NOT NULL default '600', `AlarmFrameCount` smallint(5) unsigned NOT NULL default '1',
FrameSkip smallint(5) unsigned NOT NULL default '0', `SectionLength` int(10) unsigned NOT NULL default '600',
MaxFPS decimal(5,2) default NULL, `FrameSkip` smallint(5) unsigned NOT NULL default '0',
AlarmMaxFPS decimal(5,2) default NULL, `MaxFPS` decimal(5,2) default NULL,
FPSReportInterval smallint(5) unsigned NOT NULL default '250', `AlarmMaxFPS` decimal(5,2) default NULL,
RefBlendPerc tinyint(3) unsigned NOT NULL default '10', `FPSReportInterval` smallint(5) unsigned NOT NULL default '250',
Controllable tinyint(3) unsigned NOT NULL default '0', `RefBlendPerc` tinyint(3) unsigned NOT NULL default '10',
ControlId int(10) unsigned NOT NULL default '0', `Controllable` tinyint(3) unsigned NOT NULL default '0',
ControlDevice varchar(255) default NULL, `ControlId` int(10) unsigned NOT NULL default '0',
ControlAddress varchar(255) default NULL, `ControlDevice` varchar(255) default NULL,
AutoStopTimeout decimal(5,2) default NULL, `ControlAddress` varchar(255) default NULL,
TrackMotion tinyint(3) unsigned NOT NULL default '0', `AutoStopTimeout` decimal(5,2) default NULL,
TrackDelay smallint(5) unsigned NOT NULL default '0', `TrackMotion` tinyint(3) unsigned NOT NULL default '0',
ReturnLocation tinyint(3) NOT NULL default '-1', `TrackDelay` smallint(5) unsigned NOT NULL default '0',
ReturnDelay smallint(5) unsigned NOT NULL default '0', `ReturnLocation` tinyint(3) NOT NULL default '-1',
DefaultRate smallint(5) unsigned NOT NULL default '100', `ReturnDelay` smallint(5) unsigned NOT NULL default '0',
DefaultScale smallint(5) unsigned NOT NULL default '100', `DefaultView` enum('Events','Control') NOT NULL default 'Events',
WebColour varchar(32) NOT NULL default 'red', `DefaultRate` smallint(5) unsigned NOT NULL default '100',
Sequence smallint(5) unsigned default NULL, `DefaultScale` smallint(5) unsigned NOT NULL default '100',
PRIMARY KEY (Id) `WebColour` varchar(32) NOT NULL default 'red',
) TYPE=MyISAM; `Sequence` smallint(5) unsigned default NULL,
PRIMARY KEY (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `States` -- Table structure for table `States`
-- --
CREATE TABLE States ( DROP TABLE IF EXISTS `States`;
Name varchar(64) NOT NULL default '', CREATE TABLE `States` (
Definition tinytext NOT NULL, `Name` varchar(64) NOT NULL default '',
PRIMARY KEY (Name) `Definition` tinytext NOT NULL,
) TYPE=MyISAM; PRIMARY KEY (`Name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Stats` -- Table structure for table `Stats`
-- --
CREATE TABLE Stats ( DROP TABLE IF EXISTS `Stats`;
MonitorId int(10) unsigned NOT NULL default '0', CREATE TABLE `Stats` (
ZoneId int(10) unsigned NOT NULL default '0', `MonitorId` int(10) unsigned NOT NULL default '0',
EventId int(10) unsigned NOT NULL default '0', `ZoneId` int(10) unsigned NOT NULL default '0',
FrameId int(10) unsigned NOT NULL default '0', `EventId` int(10) unsigned NOT NULL default '0',
PixelDiff tinyint(3) unsigned NOT NULL default '0', `FrameId` int(10) unsigned NOT NULL default '0',
AlarmPixels int(10) unsigned NOT NULL default '0', `PixelDiff` tinyint(3) unsigned NOT NULL default '0',
FilterPixels int(10) unsigned NOT NULL default '0', `AlarmPixels` int(10) unsigned NOT NULL default '0',
BlobPixels int(10) unsigned NOT NULL default '0', `FilterPixels` int(10) unsigned NOT NULL default '0',
Blobs smallint(5) unsigned NOT NULL default '0', `BlobPixels` int(10) unsigned NOT NULL default '0',
MinBlobSize int(10) unsigned NOT NULL default '0', `Blobs` smallint(5) unsigned NOT NULL default '0',
MaxBlobSize int(10) unsigned NOT NULL default '0', `MinBlobSize` int(10) unsigned NOT NULL default '0',
MinX smallint(5) unsigned NOT NULL default '0', `MaxBlobSize` int(10) unsigned NOT NULL default '0',
MaxX smallint(5) unsigned NOT NULL default '0', `MinX` smallint(5) unsigned NOT NULL default '0',
MinY smallint(5) unsigned NOT NULL default '0', `MaxX` smallint(5) unsigned NOT NULL default '0',
MaxY smallint(5) unsigned NOT NULL default '0', `MinY` smallint(5) unsigned NOT NULL default '0',
Score smallint(5) unsigned NOT NULL default '0', `MaxY` smallint(5) unsigned NOT NULL default '0',
KEY EventId (EventId), `Score` smallint(5) unsigned NOT NULL default '0',
KEY MonitorId (MonitorId), KEY `EventId` (`EventId`),
KEY ZoneId (ZoneId) KEY `MonitorId` (`MonitorId`),
) TYPE=MyISAM; KEY `ZoneId` (`ZoneId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `TriggersX10` -- Table structure for table `TriggersX10`
-- --
CREATE TABLE TriggersX10 ( DROP TABLE IF EXISTS `TriggersX10`;
MonitorId int(10) unsigned NOT NULL default '0', CREATE TABLE `TriggersX10` (
Activation varchar(32) default NULL, `MonitorId` int(10) unsigned NOT NULL default '0',
AlarmInput varchar(32) default NULL, `Activation` varchar(32) default NULL,
AlarmOutput varchar(32) default NULL, `AlarmInput` varchar(32) default NULL,
PRIMARY KEY (MonitorId) `AlarmOutput` varchar(32) default NULL,
) TYPE=MyISAM; PRIMARY KEY (`MonitorId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Users` -- Table structure for table `Users`
-- --
CREATE TABLE Users ( DROP TABLE IF EXISTS `Users`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Users` (
Username varchar(32) binary NOT NULL default '', `Id` int(10) unsigned NOT NULL auto_increment,
Password varchar(64) NOT NULL default '', `Username` varchar(32) character set latin1 collate latin1_bin NOT NULL default '',
Language varchar(8) NOT NULL default '', `Password` varchar(64) NOT NULL default '',
Enabled tinyint(3) unsigned NOT NULL default '1', `Language` varchar(8) NOT NULL default '',
Stream enum('None','View') NOT NULL default 'None', `Enabled` tinyint(3) unsigned NOT NULL default '1',
Events enum('None','View','Edit') NOT NULL default 'None', `Stream` enum('None','View') NOT NULL default 'None',
Control enum('None','View','Edit') NOT NULL default 'None', `Events` enum('None','View','Edit') NOT NULL default 'None',
Monitors enum('None','View','Edit') NOT NULL default 'None', `Control` enum('None','View','Edit') NOT NULL default 'None',
System enum('None','View','Edit') NOT NULL default 'None', `Monitors` enum('None','View','Edit') NOT NULL default 'None',
MaxBandwidth varchar(16) NOT NULL default '', `Devices` enum('None','View','Edit') NOT NULL default 'None',
MonitorIds tinytext NOT NULL, `System` enum('None','View','Edit') NOT NULL default 'None',
PRIMARY KEY (Id), `MaxBandwidth` varchar(16) NOT NULL default '',
UNIQUE KEY UC_Id (Id), `MonitorIds` tinytext NOT NULL,
UNIQUE KEY UC_Username (Username) PRIMARY KEY (`Id`),
) TYPE=MyISAM; UNIQUE KEY `UC_Id` (`Id`),
UNIQUE KEY `UC_Username` (`Username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `ZonePresets` -- Table structure for table `ZonePresets`
-- --
CREATE TABLE ZonePresets ( DROP TABLE IF EXISTS `ZonePresets`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `ZonePresets` (
Name varchar(64) NOT NULL default '', `Id` int(10) unsigned NOT NULL auto_increment,
Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', `Name` varchar(64) NOT NULL default '',
Units enum('Pixels','Percent') NOT NULL default 'Pixels', `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active',
CheckMethod enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', `Units` enum('Pixels','Percent') NOT NULL default 'Pixels',
MinPixelThreshold smallint(5) unsigned default NULL, `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs',
MaxPixelThreshold smallint(5) unsigned default NULL, `MinPixelThreshold` smallint(5) unsigned default NULL,
MinAlarmPixels int(10) unsigned default NULL, `MaxPixelThreshold` smallint(5) unsigned default NULL,
MaxAlarmPixels int(10) unsigned default NULL, `MinAlarmPixels` int(10) unsigned default NULL,
FilterX tinyint(3) unsigned default NULL, `MaxAlarmPixels` int(10) unsigned default NULL,
FilterY tinyint(3) unsigned default NULL, `FilterX` tinyint(3) unsigned default NULL,
MinFilterPixels int(10) unsigned default NULL, `FilterY` tinyint(3) unsigned default NULL,
MaxFilterPixels int(10) unsigned default NULL, `MinFilterPixels` int(10) unsigned default NULL,
MinBlobPixels int(10) unsigned default NULL, `MaxFilterPixels` int(10) unsigned default NULL,
MaxBlobPixels int(10) unsigned default NULL, `MinBlobPixels` int(10) unsigned default NULL,
MinBlobs smallint(5) unsigned default NULL, `MaxBlobPixels` int(10) unsigned default NULL,
MaxBlobs smallint(5) unsigned default NULL, `MinBlobs` smallint(5) unsigned default NULL,
PRIMARY KEY (Id), `MaxBlobs` smallint(5) unsigned default NULL,
UNIQUE KEY UC_Id (Id) PRIMARY KEY (`Id`),
) TYPE=MyISAM; UNIQUE KEY `UC_Id` (`Id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --
-- Table structure for table `Zones` -- Table structure for table `Zones`
-- --
CREATE TABLE Zones ( DROP TABLE IF EXISTS `Zones`;
Id int(10) unsigned NOT NULL auto_increment, CREATE TABLE `Zones` (
MonitorId int(10) unsigned NOT NULL default '0', `Id` int(10) unsigned NOT NULL auto_increment,
Name varchar(64) NOT NULL default '', `MonitorId` int(10) unsigned NOT NULL default '0',
Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active', `Name` varchar(64) NOT NULL default '',
Units enum('Pixels','Percent') NOT NULL default 'Pixels', `Type` enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active',
NumCoords tinyint(3) unsigned NOT NULL default '0', `Units` enum('Pixels','Percent') NOT NULL default 'Pixels',
Coords tinytext NOT NULL, `NumCoords` tinyint(3) unsigned NOT NULL default '0',
Area int(10) unsigned NOT NULL default '0', `Coords` tinytext NOT NULL,
AlarmRGB int(10) unsigned default '0', `Area` int(10) unsigned NOT NULL default '0',
CheckMethod enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs', `AlarmRGB` int(10) unsigned default '0',
MinPixelThreshold smallint(5) unsigned default NULL, `CheckMethod` enum('AlarmedPixels','FilteredPixels','Blobs') NOT NULL default 'Blobs',
MaxPixelThreshold smallint(5) unsigned default NULL, `MinPixelThreshold` smallint(5) unsigned default NULL,
MinAlarmPixels int(10) unsigned default NULL, `MaxPixelThreshold` smallint(5) unsigned default NULL,
MaxAlarmPixels int(10) unsigned default NULL, `MinAlarmPixels` int(10) unsigned default NULL,
FilterX tinyint(3) unsigned default NULL, `MaxAlarmPixels` int(10) unsigned default NULL,
FilterY tinyint(3) unsigned default NULL, `FilterX` tinyint(3) unsigned default NULL,
MinFilterPixels int(10) unsigned default NULL, `FilterY` tinyint(3) unsigned default NULL,
MaxFilterPixels int(10) unsigned default NULL, `MinFilterPixels` int(10) unsigned default NULL,
MinBlobPixels int(10) unsigned default NULL, `MaxFilterPixels` int(10) unsigned default NULL,
MaxBlobPixels int(10) unsigned default NULL, `MinBlobPixels` int(10) unsigned default NULL,
MinBlobs smallint(5) unsigned default NULL, `MaxBlobPixels` int(10) unsigned default NULL,
MaxBlobs smallint(5) unsigned default NULL, `MinBlobs` smallint(5) unsigned default NULL,
PRIMARY KEY (Id), `MaxBlobs` smallint(5) unsigned default NULL,
UNIQUE KEY UC_Id (Id), PRIMARY KEY (`Id`),
KEY MonitorId (MonitorId) UNIQUE KEY `UC_Id` (`Id`),
) TYPE=MyISAM; KEY `MonitorId` (`MonitorId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--
-- Initial data to be loaded into ZoneMinder database
--
-- --
-- Create a default admin user. -- Create a default admin user.