From ac3cd697ed00c36778dcd83af024d993709d59a6 Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 9 Mar 2004 17:02:17 +0000 Subject: [PATCH] Removed Id from Filters table. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@933 e3e1d417-86f3-4887-817a-d78f3d33393f --- db/zmalter-1.18.1.sql | 7 ++++++- db/zmschema.sql.z | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/db/zmalter-1.18.1.sql b/db/zmalter-1.18.1.sql index 36690b6f4..febfcd87e 100644 --- a/db/zmalter-1.18.1.sql +++ b/db/zmalter-1.18.1.sql @@ -1,12 +1,17 @@ -- -- This updates a 1.18.1 database to 1.19.0 -- --- Make changes to Zones table +-- Make changes to Frames table -- alter table Frames add column Type enum('Normal','Bulk','Alarm') NOT NULL default 'Normal' after FrameId; update Frames set Type = 'Alarm' where AlarmFrame = 1; alter table Frames drop column AlarmFrame; -- +-- Make changes to Filters table +update Filters set Name = concat( Name, '_', Id ); +alter table Filters drop column Id; +alter table Filters add primary key(Name); +-- -- These are optional, but we might as well -- optimize table Frames; diff --git a/db/zmschema.sql.z b/db/zmschema.sql.z index 0073d5f5a..aa8f9e284 100644 --- a/db/zmschema.sql.z +++ b/db/zmschema.sql.z @@ -67,7 +67,6 @@ CREATE TABLE Events ( -- CREATE TABLE Filters ( - Id int(10) unsigned NOT NULL auto_increment, Name varchar(64) NOT NULL default '', Query text NOT NULL, AutoArchive tinyint(3) unsigned NOT NULL default '0', @@ -75,7 +74,7 @@ CREATE TABLE Filters ( AutoUpload tinyint(3) unsigned NOT NULL default '0', AutoEmail tinyint(3) unsigned NOT NULL default '0', AutoMessage tinyint(3) unsigned NOT NULL default '0', - PRIMARY KEY (Id) + PRIMARY KEY (Name) ) TYPE=MyISAM; --