Skip to content

Commit

Permalink
Sync: allow notification, dependency, scheduled dt
Browse files Browse the repository at this point in the history
fixes #925
fixes #1209
fixes #1211
fixes #1212
  • Loading branch information
Thomas-Gelf committed Sep 6, 2019
1 parent 7d7c4de commit 4fcda46
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 16 deletions.
31 changes: 17 additions & 14 deletions application/forms/SyncRuleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,23 @@ class SyncRuleForm extends DirectorObjectForm
{
public function setup()
{
$availableTypes = array(
'host' => $this->translate('Host'),
'hostgroup' => $this->translate('Host Group'),
'service' => $this->translate('Service'),
'servicegroup' => $this->translate('Service Group'),
'serviceSet' => $this->translate('Service Set'),
'user' => $this->translate('User'),
'usergroup' => $this->translate('User Group'),
'datalistEntry' => $this->translate('Data List Entry'),
'command' => $this->translate('Command'),
'timePeriod' => $this->translate('Time Period'),
'endpoint' => $this->translate('Endpoint'),
'zone' => $this->translate('Zone'),
);
$availableTypes = [
'host' => $this->translate('Host'),
'hostgroup' => $this->translate('Host Group'),
'service' => $this->translate('Service'),
'servicegroup' => $this->translate('Service Group'),
'serviceSet' => $this->translate('Service Set'),
'user' => $this->translate('User'),
'usergroup' => $this->translate('User Group'),
'datalistEntry' => $this->translate('Data List Entry'),
'command' => $this->translate('Command'),
'timePeriod' => $this->translate('Time Period'),
'notification' => $this->translate('Notification'),
'scheduledDowntime' => $this->translate('Scheduled Downtime'),
'dependency' => $this->translate('Dependency'),
'endpoint' => $this->translate('Endpoint'),
'zone' => $this->translate('Zone'),
];

$this->addElement('text', 'rule_name', array(
'label' => $this->translate('Rule name'),
Expand Down
21 changes: 21 additions & 0 deletions schema/mysql-migrations/upgrade_166.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ALTER TABLE sync_rule MODIFY object_type enum(
'host',
'service',
'command',
'user',
'hostgroup',
'servicegroup',
'usergroup',
'datalistEntry',
'endpoint',
'zone',
'timePeriod',
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
) NOT NULL;

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (166, NOW());
5 changes: 4 additions & 1 deletion schema/mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,10 @@ CREATE TABLE sync_rule (
'endpoint',
'zone',
'timePeriod',
'serviceSet'
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
) NOT NULL,
update_policy ENUM('merge', 'override', 'ignore') NOT NULL,
purge_existing ENUM('y', 'n') NOT NULL DEFAULT 'n',
Expand Down
7 changes: 7 additions & 0 deletions schema/pgsql-migrations/upgrade_166.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'scheduledDowntime';
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'notification';
ALTER TYPE enum_sync_rule_object_type ADD VALUE 'dependency';

INSERT INTO director_schema_migration
(schema_version, migration_time)
VALUES (166, NOW());
5 changes: 4 additions & 1 deletion schema/pgsql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ CREATE TYPE enum_sync_rule_object_type AS ENUM(
'endpoint',
'zone',
'timePeriod',
'serviceSet'
'serviceSet',
'scheduledDowntime',
'notification',
'dependency'
);
CREATE TYPE enum_sync_rule_update_policy AS ENUM('merge', 'override', 'ignore');
CREATE TYPE enum_sync_property_merge_policy AS ENUM('override', 'merge');
Expand Down

0 comments on commit 4fcda46

Please sign in to comment.