IcingaUser: remove obsolete states stub

This commit is contained in:
Thomas Gelf 2016-02-29 18:29:18 +01:00
parent 47f20c93a3
commit 62c1aec917
3 changed files with 35 additions and 14 deletions

View File

@ -29,15 +29,8 @@ class IcingaUser extends IcingaObject
'enable_notifications' => 'enable_notifications' 'enable_notifications' => 'enable_notifications'
); );
protected $states = array(); protected $relatedSets = array(
'states' => 'StateFilterSet',
protected function setStates($value) 'types' => 'TypeFilterSet',
{ );
$states = $value;
sort($states);
if ($this->states !== $states) {
$this->states = $states;
$this->hasBeenModified = true;
}
}
} }

View File

@ -0,0 +1,28 @@
DROP TABLE icinga_user_filters_set;
CREATE TABLE icinga_user_types_set (
user_id INT(10) UNSIGNED NOT NULL,
property ENUM(
'DowntimeStart',
'DowntimeEnd',
'DowntimeRemoved',
'Custom',
'Acknowledgement',
'Problem',
'Recovery',
'FlappingStart',
'FlappingEnd'
) NOT NULL,
merge_behaviour ENUM('override', 'extend', 'blacklist') NOT NULL DEFAULT 'override'
COMMENT 'override: = [], extend: += [], blacklist: -= []',
PRIMARY KEY (user_id, property, merge_behaviour),
CONSTRAINT icinga_user_types_set_user
FOREIGN KEY icinga_user (user_id)
REFERENCES icinga_user (id)
ON DELETE CASCADE
ON UPDATE CASCADE
) ENGINE=InnoDB;
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 76;

View File

@ -799,7 +799,7 @@ CREATE TABLE icinga_user_states_set (
ON UPDATE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB; ) ENGINE=InnoDB;
CREATE TABLE icinga_user_filters_set ( CREATE TABLE icinga_user_types_set (
user_id INT(10) UNSIGNED NOT NULL, user_id INT(10) UNSIGNED NOT NULL,
property ENUM( property ENUM(
'DowntimeStart', 'DowntimeStart',
@ -815,7 +815,7 @@ CREATE TABLE icinga_user_filters_set (
merge_behaviour ENUM('override', 'extend', 'blacklist') NOT NULL DEFAULT 'override' merge_behaviour ENUM('override', 'extend', 'blacklist') NOT NULL DEFAULT 'override'
COMMENT 'override: = [], extend: += [], blacklist: -= []', COMMENT 'override: = [], extend: += [], blacklist: -= []',
PRIMARY KEY (user_id, property, merge_behaviour), PRIMARY KEY (user_id, property, merge_behaviour),
CONSTRAINT icinga_user_filters_set_user CONSTRAINT icinga_user_types_set_user
FOREIGN KEY icinga_user (user_id) FOREIGN KEY icinga_user (user_id)
REFERENCES icinga_user (id) REFERENCES icinga_user (id)
ON DELETE CASCADE ON DELETE CASCADE
@ -1112,4 +1112,4 @@ CREATE TABLE sync_run (
INSERT INTO director_schema_migration INSERT INTO director_schema_migration
SET migration_time = NOW(), SET migration_time = NOW(),
schema_version = 75; schema_version = 76;