Merge branch 'filter_id' into storageareas

pull/1624/head
Isaac Connor 2016-05-30 10:28:40 -04:00
commit f86c7735e3
2 changed files with 28 additions and 0 deletions

View File

@ -217,6 +217,7 @@ CREATE TABLE `Events` (
DROP TABLE IF EXISTS `Filters`;
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',
@ -228,8 +229,13 @@ CREATE TABLE `Filters` (
`AutoExecuteCmd` tinytext,
`AutoDelete` tinyint(3) unsigned NOT NULL default '0',
`Background` tinyint(1) unsigned NOT NULL default '0',
<<<<<<< HEAD
`Concurrent` tinyint(1) unsigned NOT NULL default '0',
PRIMARY KEY (`Name`)
=======
PRIMARY KEY (`Id`),
KEY `Name` (`Name`)
>>>>>>> filter_id
) ENGINE=@ZM_MYSQL_ENGINE@;
--

22
db/zm_update-1.30.3.sql Normal file
View File

@ -0,0 +1,22 @@
--
-- This updates a 1.29.0 database to 1.29.1
--
--
--
-- Add an Id column and make it the primary key of the Filters table
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Filters'
AND table_schema = DATABASE()
AND column_name = 'Id'
) > 0,
"SELECT 'Column Id exists in Filters'",
"ALTER TABLE `Filters` DROP PRIMARY KEY; ALTER TABLE `Filters` ADD `Id` int(10) unsigned NOT NULL auto_increment PRIMARY KEY FIRST; ALTER TABLE Filters ADD KEY `Name` (`Name`);"
));
PREPARE stmt FROM @s;
EXECUTE stmt;