diff --git a/db/zmalter-0.0.1.sql b/db/zmalter-0.0.1.sql index 892bcc48f..568d800bb 100644 --- a/db/zmalter-0.0.1.sql +++ b/db/zmalter-0.0.1.sql @@ -20,7 +20,9 @@ alter table Monitors modify column Function enum('None','Passive','Active','X10' update Monitors set LabelFormat = '%%s - %y/%m/%d %H:%M:%S'; update Monitors set LabelX = 0; update Monitors set LabelY = Height-8; -alter table Events add column LearnState char(1) default '' after Archived; +alter table Events modify column Archived tinyint unsigned not null default 0; +alter table Events add column Uploaded tinyint unsigned not null default 0 after Archived; +alter table Events add column LearnState char(1) default '' after Uploaded; CREATE TABLE Filters ( Id int(10) unsigned NOT NULL auto_increment, MonitorId int(10) unsigned NOT NULL default '0', diff --git a/db/zmschema.sql.z b/db/zmschema.sql.z index a29a07412..b2f2a9955 100644 --- a/db/zmschema.sql.z +++ b/db/zmschema.sql.z @@ -27,12 +27,14 @@ CREATE TABLE Events ( AlarmFrames int(10) unsigned default NULL, AvgScore tinyint(3) unsigned default '0', MaxScore tinyint(3) unsigned default '0', - Archived tinyint(4) default '0', + Archived tinyint(3) unsigned NOT NULL default '0', + Uploaded tinyint(3) unsigned NOT NULL default '0', LearnState char(1) default '', PRIMARY KEY (Id), UNIQUE KEY UC_Id (Id), KEY Id (Id,MonitorId), - KEY MonitorId (MonitorId) + KEY MonitorId (MonitorId), + KEY StartTime (StartTime) ) TYPE=MyISAM; --