154 lines
4.9 KiB
Plaintext
154 lines
4.9 KiB
Plaintext
-- MySQL dump 8.21
|
|
--
|
|
-- Host: localhost Database: zm
|
|
---------------------------------------------------------
|
|
-- Server version 3.23.49
|
|
|
|
--
|
|
-- Current Database: zm
|
|
--
|
|
|
|
CREATE DATABASE /*!32312 IF NOT EXISTS*/ zm;
|
|
|
|
USE zm;
|
|
|
|
--
|
|
-- 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,
|
|
Length int(10) unsigned default NULL,
|
|
Frames int(10) unsigned default NULL,
|
|
AlarmFrames int(10) unsigned default NULL,
|
|
AvgScore tinyint(3) unsigned default '0',
|
|
MaxScore tinyint(3) unsigned default '0',
|
|
Archived tinyint(4) default '0',
|
|
LearnState char(1) default '',
|
|
PRIMARY KEY (Id),
|
|
UNIQUE KEY UC_Id (Id),
|
|
KEY Id (Id,MonitorId),
|
|
KEY MonitorId (MonitorId)
|
|
) TYPE=MyISAM;
|
|
|
|
--
|
|
-- 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,
|
|
AutoDelete tinyint(4) NOT NULL default '0',
|
|
AutoUpload tinyint(4) NOT NULL default '0',
|
|
PRIMARY KEY (Id),
|
|
UNIQUE KEY FilterIDX (MonitorId,Name)
|
|
) TYPE=MyISAM;
|
|
|
|
--
|
|
-- 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,
|
|
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,
|
|
Function enum('None','Passive','Active','X10') NOT NULL default 'Passive',
|
|
Device tinyint(3) unsigned NOT NULL default '0',
|
|
Channel tinyint(3) unsigned NOT NULL default '0',
|
|
Format tinyint(3) unsigned NOT NULL default '0',
|
|
Width smallint(5) unsigned NOT NULL default '0',
|
|
Height smallint(5) unsigned NOT NULL default '0',
|
|
Colours tinyint(3) unsigned NOT NULL default '0',
|
|
LabelFormat varchar(32) NOT NULL default '%%s - %y/%m/%d %H:%M:%S',
|
|
LabelX smallint(5) unsigned default NULL,
|
|
LabelY smallint(5) unsigned default NULL,
|
|
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',
|
|
AlarmFrameCount smallint(5) unsigned NOT NULL default '1',
|
|
FPSReportInterval smallint(5) unsigned NOT NULL default '250',
|
|
RefBlendPerc tinyint(3) unsigned NOT NULL default '10',
|
|
X10Active varchar(32) default NULL,
|
|
X10Alarm varchar(32) default NULL,
|
|
PRIMARY KEY (Id)
|
|
) TYPE=MyISAM;
|
|
|
|
--
|
|
-- 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',
|
|
Score smallint(5) unsigned NOT NULL default '0',
|
|
KEY EventId (EventId),
|
|
KEY MonitorId (MonitorId),
|
|
KEY ZoneId (ZoneId)
|
|
) TYPE=MyISAM;
|
|
|
|
--
|
|
-- 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,
|
|
Type enum('Active','Inclusive','Exclusive','Inactive') default 'Active',
|
|
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;
|
|
|