mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-21 21:04:26 +02:00
Zone: rename parent_zone to parent
This commit is contained in:
parent
1a76bc0b1f
commit
0c68677fa5
@ -26,7 +26,7 @@ class IcingaZoneForm extends DirectorObjectForm
|
||||
'required' => true,
|
||||
));
|
||||
|
||||
$this->addElement('select', 'parent_zone_id', array(
|
||||
$this->addElement('select', 'parent_id', array(
|
||||
'label' => $this->translate('Parent Zone'),
|
||||
'description' => $this->translate('Chose an (optional) parent zone'),
|
||||
'multiOptions' => $this->optionalEnum($this->db->enumZones())
|
||||
|
@ -170,7 +170,7 @@ constants
|
||||
public function getZoneObjects()
|
||||
{
|
||||
return $this->getDirectorObjects('Zone', 'Zone', 'zones', array(
|
||||
'parent' => 'parent_zone',
|
||||
'parent' => 'parent',
|
||||
'global' => 'is_global',
|
||||
));
|
||||
}
|
||||
|
@ -9,11 +9,11 @@ class IcingaZone extends IcingaObject
|
||||
protected $table = 'icinga_zone';
|
||||
|
||||
protected $defaultProperties = array(
|
||||
'id' => null,
|
||||
'object_name' => null,
|
||||
'object_type' => null,
|
||||
'parent_zone_id' => null,
|
||||
'is_global' => 'n',
|
||||
'id' => null,
|
||||
'object_name' => null,
|
||||
'object_type' => null,
|
||||
'parent_id' => null,
|
||||
'is_global' => 'n',
|
||||
);
|
||||
|
||||
protected $booleans = array(
|
||||
@ -22,7 +22,7 @@ class IcingaZone extends IcingaObject
|
||||
);
|
||||
|
||||
protected $relations = array(
|
||||
'parent_zone' => 'IcingaZone',
|
||||
'parent' => 'IcingaZone',
|
||||
);
|
||||
|
||||
protected $supportsImports = true;
|
||||
@ -48,13 +48,4 @@ class IcingaZone extends IcingaObject
|
||||
|
||||
return $db->fetchCol($query);
|
||||
}
|
||||
|
||||
protected function renderParent_zone_id()
|
||||
{
|
||||
return $this->renderRelationProperty(
|
||||
'parent_zone',
|
||||
$this->parent_zone_id,
|
||||
'parent'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
8
schema/mysql-changes/upgrade_55.sql
Normal file
8
schema/mysql-changes/upgrade_55.sql
Normal file
@ -0,0 +1,8 @@
|
||||
ALTER TABLE icinga_zone
|
||||
DROP FOREIGN KEY icinga_zone_parent_zone,
|
||||
CHANGE parent_zone_id parent_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
ADD CONSTRAINT icinga_zone_parent
|
||||
FOREIGN KEY parent_zone (parent_id)
|
||||
REFERENCES icinga_zone (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE;
|
@ -146,14 +146,14 @@ CREATE TABLE director_datafield_setting (
|
||||
|
||||
CREATE TABLE icinga_zone (
|
||||
id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
|
||||
parent_zone_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
parent_id INT(10) UNSIGNED DEFAULT NULL,
|
||||
object_name VARCHAR(255) NOT NULL,
|
||||
object_type ENUM('object', 'template', 'external_object') NOT NULL,
|
||||
is_global ENUM('y', 'n') NOT NULL DEFAULT 'n',
|
||||
PRIMARY KEY (id),
|
||||
UNIQUE INDEX object_name (object_name),
|
||||
CONSTRAINT icinga_zone_parent_zone
|
||||
FOREIGN KEY parent_zone (parent_zone_id)
|
||||
CONSTRAINT icinga_zone_parent
|
||||
FOREIGN KEY parent_zone (parent_id)
|
||||
REFERENCES icinga_zone (id)
|
||||
ON DELETE RESTRICT
|
||||
ON UPDATE CASCADE
|
||||
|
Loading…
x
Reference in New Issue
Block a user