2002-09-23 23:59:50 +08:00
|
|
|
-- MySQL dump 8.21
|
|
|
|
--
|
2003-01-15 18:04:53 +08:00
|
|
|
-- Host: localhost Database: ZM_DB_NAME
|
2002-09-23 23:59:50 +08:00
|
|
|
---------------------------------------------------------
|
2003-06-30 05:53:55 +08:00
|
|
|
-- Server version 3.23.49
|
2002-09-23 23:59:50 +08:00
|
|
|
|
2002-12-10 20:33:44 +08:00
|
|
|
--
|
2003-01-15 18:04:53 +08:00
|
|
|
-- Current Database: ZM_DB_NAME
|
2002-12-10 20:33:44 +08:00
|
|
|
--
|
|
|
|
|
2003-01-15 18:04:53 +08:00
|
|
|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ ZM_DB_NAME;
|
2002-12-10 20:33:44 +08:00
|
|
|
|
2003-01-15 18:04:53 +08:00
|
|
|
USE ZM_DB_NAME;
|
2002-12-10 20:33:44 +08:00
|
|
|
|
2003-07-04 21:26:14 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Config'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Config (
|
|
|
|
Id smallint(5) unsigned NOT NULL default '0',
|
|
|
|
Name varchar(32) NOT NULL default '',
|
|
|
|
Value text NOT NULL,
|
|
|
|
Type tinytext NOT NULL,
|
|
|
|
DefaultValue tinytext,
|
|
|
|
Hint tinytext,
|
|
|
|
Pattern tinytext,
|
|
|
|
Format tinytext,
|
|
|
|
Prompt tinytext,
|
|
|
|
Help text,
|
|
|
|
Category varchar(32) NOT NULL default '',
|
|
|
|
Readonly tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
Requires text,
|
|
|
|
PRIMARY KEY (Name),
|
|
|
|
UNIQUE KEY UC_Name (Name)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2002-09-23 23:59:50 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Events'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Events (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
MonitorId int(10) unsigned NOT NULL default '0',
|
|
|
|
Name tinytext NOT NULL,
|
|
|
|
StartTime datetime default NULL,
|
|
|
|
EndTime datetime default NULL,
|
2003-03-11 23:13:44 +08:00
|
|
|
Length decimal(10,2) NOT NULL default '0.00',
|
2002-09-23 23:59:50 +08:00
|
|
|
Frames int(10) unsigned default NULL,
|
|
|
|
AlarmFrames int(10) unsigned default NULL,
|
2003-01-07 22:32:23 +08:00
|
|
|
TotScore int(10) unsigned NOT NULL default '0',
|
2002-09-23 23:59:50 +08:00
|
|
|
AvgScore tinyint(3) unsigned default '0',
|
|
|
|
MaxScore tinyint(3) unsigned default '0',
|
2003-01-07 20:49:25 +08:00
|
|
|
Archived tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
Uploaded tinyint(3) unsigned NOT NULL default '0',
|
2003-01-15 18:04:53 +08:00
|
|
|
Emailed tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
Messaged tinyint(3) unsigned NOT NULL default '0',
|
2002-12-10 20:33:44 +08:00
|
|
|
LearnState char(1) default '',
|
2002-09-23 23:59:50 +08:00
|
|
|
PRIMARY KEY (Id),
|
|
|
|
UNIQUE KEY UC_Id (Id),
|
|
|
|
KEY Id (Id,MonitorId),
|
2003-01-07 20:49:25 +08:00
|
|
|
KEY MonitorId (MonitorId),
|
|
|
|
KEY StartTime (StartTime)
|
2002-09-23 23:59:50 +08:00
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2002-12-10 20:33:44 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Filters'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Filters (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
MonitorId int(10) unsigned NOT NULL default '0',
|
|
|
|
Name varchar(64) NOT NULL default '',
|
|
|
|
Query text NOT NULL,
|
2003-04-22 23:47:57 +08:00
|
|
|
AutoArchive tinyint(3) unsigned NOT NULL default '0',
|
2003-01-15 18:04:53 +08:00
|
|
|
AutoDelete tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
AutoUpload tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
AutoEmail tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
AutoMessage tinyint(3) unsigned NOT NULL default '0',
|
2002-12-10 20:33:44 +08:00
|
|
|
PRIMARY KEY (Id),
|
|
|
|
UNIQUE KEY FilterIDX (MonitorId,Name)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2002-09-23 23:59:50 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Frames'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Frames (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
EventId int(10) unsigned NOT NULL default '0',
|
|
|
|
FrameId int(10) unsigned NOT NULL default '0',
|
|
|
|
AlarmFrame tinyint(4) NOT NULL default '0',
|
|
|
|
ImagePath tinytext NOT NULL,
|
|
|
|
TimeStamp timestamp(14) NOT NULL,
|
2003-03-11 23:13:44 +08:00
|
|
|
Delta decimal(8,2) NOT NULL default '0.00',
|
2002-09-23 23:59:50 +08:00
|
|
|
Score smallint(5) unsigned NOT NULL default '0',
|
|
|
|
PRIMARY KEY (Id),
|
|
|
|
UNIQUE KEY UC_Id (Id),
|
|
|
|
KEY EventId (EventId)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
|
|
|
--
|
|
|
|
-- Table structure for table 'Monitors'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Monitors (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
Name tinytext NOT NULL,
|
2003-03-26 20:48:15 +08:00
|
|
|
Type enum('Local','Remote') NOT NULL default 'Local',
|
2003-09-23 17:52:45 +08:00
|
|
|
Function enum('None','Monitor','Modect','Record','Mocord') NOT NULL default 'Monitor',
|
|
|
|
RunMode enum('Continuous','Triggered') NOT NULL default 'Continuous',
|
|
|
|
Triggers set('X10') NOT NULL default '',
|
2002-11-22 20:10:47 +08:00
|
|
|
Device tinyint(3) unsigned NOT NULL default '0',
|
2002-09-23 23:59:50 +08:00
|
|
|
Channel tinyint(3) unsigned NOT NULL default '0',
|
2002-11-22 20:10:47 +08:00
|
|
|
Format tinyint(3) unsigned NOT NULL default '0',
|
2003-03-26 20:48:15 +08:00
|
|
|
Host varchar(64) default NULL,
|
|
|
|
Port varchar(8) default '80',
|
|
|
|
Path varchar(255) default NULL,
|
2002-09-23 23:59:50 +08:00
|
|
|
Width smallint(5) unsigned NOT NULL default '0',
|
|
|
|
Height smallint(5) unsigned NOT NULL default '0',
|
2003-04-15 20:00:22 +08:00
|
|
|
Palette tinyint(3) unsigned NOT NULL default '1',
|
2003-05-02 23:03:16 +08:00
|
|
|
Orientation enum('0','90','180','270') NOT NULL default '0',
|
2002-11-22 20:10:47 +08:00
|
|
|
LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S',
|
2002-09-23 23:59:50 +08:00
|
|
|
LabelX smallint(5) unsigned default NULL,
|
|
|
|
LabelY smallint(5) unsigned default NULL,
|
2002-11-22 20:10:47 +08:00
|
|
|
ImageBufferCount smallint(5) unsigned NOT NULL default '100',
|
|
|
|
WarmupCount smallint(5) unsigned NOT NULL default '25',
|
|
|
|
PreEventCount smallint(5) unsigned NOT NULL default '10',
|
|
|
|
PostEventCount smallint(5) unsigned NOT NULL default '10',
|
2003-09-23 17:52:45 +08:00
|
|
|
SectionLength int(10) unsigned NOT NULL default '600',
|
2003-10-28 05:45:38 +08:00
|
|
|
FrameSkip smallint(5) unsigned NOT NULL default '0',
|
2003-03-26 22:02:26 +08:00
|
|
|
MaxFPS decimal(5,2) NOT NULL default '0.00',
|
2002-11-22 20:10:47 +08:00
|
|
|
FPSReportInterval smallint(5) unsigned NOT NULL default '250',
|
|
|
|
RefBlendPerc tinyint(3) unsigned NOT NULL default '10',
|
2002-09-23 23:59:50 +08:00
|
|
|
PRIMARY KEY (Id)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2002-12-10 20:33:44 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Stats'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Stats (
|
|
|
|
MonitorId int(10) unsigned NOT NULL default '0',
|
|
|
|
ZoneId int(10) unsigned NOT NULL default '0',
|
|
|
|
EventId int(10) unsigned NOT NULL default '0',
|
|
|
|
FrameId int(10) unsigned NOT NULL default '0',
|
|
|
|
AlarmPixels int(10) unsigned NOT NULL default '0',
|
|
|
|
FilterPixels int(10) unsigned NOT NULL default '0',
|
|
|
|
BlobPixels int(10) unsigned NOT NULL default '0',
|
|
|
|
Blobs smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MinBlobSize smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MaxBlobSize smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MinX smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MaxX smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MinY smallint(5) unsigned NOT NULL default '0',
|
|
|
|
MaxY smallint(5) unsigned NOT NULL default '0',
|
2002-12-12 07:44:59 +08:00
|
|
|
Score smallint(5) unsigned NOT NULL default '0',
|
|
|
|
KEY EventId (EventId),
|
|
|
|
KEY MonitorId (MonitorId),
|
|
|
|
KEY ZoneId (ZoneId)
|
2002-12-10 20:33:44 +08:00
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2003-09-23 17:52:45 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'TriggersX10'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE TriggersX10 (
|
|
|
|
MonitorId int(10) unsigned NOT NULL default '0',
|
|
|
|
Activation varchar(32) default NULL,
|
|
|
|
AlarmInput varchar(32) default NULL,
|
|
|
|
AlarmOutput varchar(32) default NULL,
|
|
|
|
PRIMARY KEY (MonitorId)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2003-06-30 05:53:55 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Users'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Users (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
Username varchar(32) NOT NULL default '',
|
|
|
|
Password varchar(32) NOT NULL default '',
|
|
|
|
Enabled tinyint(3) unsigned NOT NULL default '1',
|
|
|
|
Stream enum('None','View') NOT NULL default 'None',
|
|
|
|
Events enum('None','View','Edit') NOT NULL default 'None',
|
|
|
|
Monitors enum('None','View','Edit') NOT NULL default 'None',
|
|
|
|
System enum('None','View','Edit') NOT NULL default 'None',
|
|
|
|
MonitorIds tinytext,
|
|
|
|
PRIMARY KEY (Id),
|
|
|
|
UNIQUE KEY UC_Id (Id),
|
|
|
|
UNIQUE KEY UC_Username (Username)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2002-09-23 23:59:50 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table 'Zones'
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE Zones (
|
|
|
|
Id int(10) unsigned NOT NULL auto_increment,
|
|
|
|
MonitorId int(10) unsigned NOT NULL default '0',
|
|
|
|
Name tinytext NOT NULL,
|
2003-04-15 20:00:22 +08:00
|
|
|
Type enum('Active','Inclusive','Exclusive','Preclusive','Inactive') NOT NULL default 'Active',
|
2002-09-23 23:59:50 +08:00
|
|
|
Units enum('Pixels','Percent') NOT NULL default 'Pixels',
|
|
|
|
LoX smallint(5) unsigned NOT NULL default '0',
|
|
|
|
LoY smallint(5) unsigned NOT NULL default '0',
|
|
|
|
HiX smallint(5) unsigned NOT NULL default '0',
|
|
|
|
HiY smallint(5) unsigned NOT NULL default '0',
|
|
|
|
AlarmRGB int(10) unsigned default NULL,
|
|
|
|
AlarmThreshold smallint(5) unsigned default NULL,
|
|
|
|
MinAlarmPixels int(10) unsigned default NULL,
|
|
|
|
MaxAlarmPixels int(10) unsigned default NULL,
|
|
|
|
FilterX tinyint(3) unsigned default NULL,
|
|
|
|
FilterY tinyint(3) unsigned default NULL,
|
|
|
|
MinFilterPixels int(10) unsigned default NULL,
|
|
|
|
MaxFilterPixels int(10) unsigned default NULL,
|
|
|
|
MinBlobPixels smallint(5) unsigned default NULL,
|
|
|
|
MaxBlobPixels smallint(5) unsigned default NULL,
|
|
|
|
MinBlobs smallint(5) unsigned default NULL,
|
|
|
|
MaxBlobs smallint(5) unsigned default NULL,
|
|
|
|
PRIMARY KEY (Id),
|
|
|
|
UNIQUE KEY UC_Id (Id)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2003-12-11 23:21:51 +08:00
|
|
|
--
|
|
|
|
-- Table structure for table `States`
|
|
|
|
--
|
|
|
|
|
|
|
|
CREATE TABLE States (
|
|
|
|
Name varchar(32) NOT NULL default '',
|
|
|
|
Definition tinytext NOT NULL,
|
|
|
|
PRIMARY KEY (Name)
|
|
|
|
) TYPE=MyISAM;
|
|
|
|
|
2003-07-09 16:23:35 +08:00
|
|
|
--
|
|
|
|
-- Create a default admin user.
|
|
|
|
--
|
|
|
|
insert into Users values ('','admin',password('admin'),1,'View','Edit','Edit','Edit',NULL);
|