diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 40439f1d990..8fc40ed89dc 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -600,6 +600,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 ef24069815f..fd82b89ba41 100644 --- a/setup/db/db/schema-228to229.sql +++ b/setup/db/db/schema-228to229.sql @@ -9,9 +9,9 @@ ALTER TABLE `cloud`.`cluster` ADD CONSTRAINT `fk_cluster__data_center_id` FOREIG ALTER TABLE `cloud`.`op_host_capacity` DROP FOREIGN KEY `fk_op_host_capacity__pod_id`; 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');