add sql bits
This commit is contained in:
parent
2770e752b4
commit
936aa00a5e
|
@ -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 '',
|
||||
|
|
|
@ -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;
|
||||
|
Loading…
Reference in New Issue