schema: remove usergroup zone_id for now

This commit is contained in:
Thomas Gelf 2016-03-09 20:36:39 +01:00
parent 108a891731
commit d3130d0494
4 changed files with 14 additions and 6 deletions

View File

@ -0,0 +1,5 @@
ALTER TABLE icinga_usergroup DROP COLUMN zone_id;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (84, NOW());

View File

@ -858,9 +858,8 @@ CREATE TABLE icinga_usergroup (
object_type ENUM('object', 'template') NOT NULL,
disabled ENUM('y', 'n') NOT NULL DEFAULT 'n',
display_name VARCHAR(255) DEFAULT NULL,
zone_id INT(10) UNSIGNED DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE INDEX object_name (object_name, zone_id),
UNIQUE INDEX object_name (object_name),
KEY search_idx (display_name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
@ -1214,4 +1213,4 @@ CREATE TABLE sync_run (
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 82;
schema_version = 84;

View File

@ -0,0 +1,5 @@
ALTER TABLE icinga_usergroup DROP COLUMN zone_id;
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (84, NOW());

View File

@ -1041,12 +1041,11 @@ CREATE TABLE icinga_usergroup (
object_type enum_object_type_all NOT NULL,
disabled enum_boolean NOT NULL DEFAULT 'n',
display_name character varying(255) DEFAULT NULL,
zone_id integer DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE UNIQUE INDEX usergroup_search_idx ON icinga_usergroup (display_name);
CREATE INDEX usergroup_object_name ON icinga_usergroup (object_name, zone_id);
CREATE INDEX usergroup_object_name ON icinga_usergroup (object_name);
CREATE TABLE icinga_usergroup_inheritance (
@ -1425,4 +1424,4 @@ CREATE UNIQUE INDEX notification_inheritance ON icinga_notification_inheritance
-- set current schema version
INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (83, NOW());
VALUES (84, NOW());