add sql bits

This commit is contained in:
Andrew Bauer 2015-08-15 12:00:48 -05:00
parent 2770e752b4
commit 936aa00a5e
2 changed files with 24 additions and 0 deletions

View File

@ -461,6 +461,7 @@ CREATE TABLE `Users` (
`Events` enum('None','View','Edit') NOT NULL default 'None',
`Control` enum('None','View','Edit') NOT NULL default 'None',
`Monitors` enum('None','View','Edit') NOT NULL default 'None',
`Groups` enum('None','View','Edit') NOT NULL default 'None',
`Devices` enum('None','View','Edit') NOT NULL default 'None',
`System` enum('None','View','Edit') NOT NULL default 'None',
`MaxBandwidth` varchar(16) NOT NULL default '',

23
db/zm_update-1.28.101.sql Normal file
View File

@ -0,0 +1,23 @@
--
-- This updates a 1.28.100 database to 1.28.101
--
--
-- Add Groups column to Users
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Users'
AND table_schema = DATABASE()
AND column_name = 'Groups'
) > 0,
"SELECT 'Column Groups exists in Users'",
"ALTER TABLE Monitors ADD COLUMN `Groups` ENUM('None','View','Edit') NOT NULL DEFAULT 'None' AFTER `Monitors`;
));
PREPARE stmt FROM @s;
EXECUTE stmt;