diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 44e367d59b7..753ae750949 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -598,6 +598,7 @@ CREATE TABLE `cloud`.`firewall_rules_cidrs` ( `source_cidr` varchar(18) DEFAULT NULL, PRIMARY KEY (`id`), KEY `fk_firewall_cidrs_firewall_rules` (`firewall_rule_id`), + UNIQUE INDEX `unique_rule_cidrs` (`firewall_rule_id`, `source_cidr`), CONSTRAINT `fk_firewall_cidrs_firewall_rules` FOREIGN KEY (`firewall_rule_id`) REFERENCES `firewall_rules` (`id`) ON DELETE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; diff --git a/setup/db/db/schema-228to229.sql b/setup/db/db/schema-228to229.sql index fce31d37169..9846fcfd455 100644 --- a/setup/db/db/schema-228to229.sql +++ b/setup/db/db/schema-228to229.sql @@ -13,6 +13,8 @@ ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__po ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__data_center_id`; ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__cluster_id`; +ALTER TABLE `cloud`.`firewall_rules_cidrs` ADD UNIQUE INDEX `unique_rule_cidrs` (`firewall_rule_id`, `source_cidr`); + INSERT IGNORE INTO configuration VALUES ('Advanced', 'DEFAULT', 'management-server', 'agent.load.threshold', '0.70', 'Percentage (as a value between 0 and 1) of connected agents after which agent load balancing will start happening'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.visibility', 'global', 'Load Balancer(haproxy) stats visibilty, it can be global,guest-network,disabled'); INSERT IGNORE INTO configuration VALUES ('Network', 'DEFAULT', 'management-server', 'network.loadbalancer.haproxy.stats.uri','/admin?stats','Load Balancer(haproxy) uri.');