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'
);
protected $states = array();
protected function setStates($value)
{
$states = $value;
sort($states);
if ($this->states !== $states) {
$this->states = $states;
$this->hasBeenModified = true;
}
}
protected $relatedSets = array(
'states' => 'StateFilterSet',
'types' => 'TypeFilterSet',
);
}

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
) ENGINE=InnoDB;
CREATE TABLE icinga_user_filters_set (
CREATE TABLE icinga_user_types_set (
user_id INT(10) UNSIGNED NOT NULL,
property ENUM(
'DowntimeStart',
@ -815,7 +815,7 @@ CREATE TABLE icinga_user_filters_set (
merge_behaviour ENUM('override', 'extend', 'blacklist') NOT NULL DEFAULT 'override'
COMMENT 'override: = [], extend: += [], blacklist: -= []',
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)
REFERENCES icinga_user (id)
ON DELETE CASCADE
@ -1112,4 +1112,4 @@ CREATE TABLE sync_run (
INSERT INTO director_schema_migration
SET migration_time = NOW(),
schema_version = 75;
schema_version = 76;