Skip to content

Commit 5b8f079

Browse files
CloudStack-QAKishan Kavala
authored andcommitted
Accounts can hold multiple vnets. Same vnets can exist across multiple pnets. It is sufficient to constrain a single vnet in a given pnet within a datacenter. i_op_dc_vnet_alloc__vnet__data_center_id covers all use cases for the table.
Having `i_op_dc_vnet_alloc__vnet__data_center_id__account_id` will restrict same account holding the same vnet across different physical networks. Signed-off-by: Kishan Kavala <kishan@cloud.com>
1 parent b683c34 commit 5b8f079

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

setup/db/db/schema-40to410.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,8 @@ ALTER TABLE `cloud`.`op_dc_vnet_alloc` DROP INDEX i_op_dc_vnet_alloc__vnet__data
251251

252252
ALTER TABLE `cloud`.`op_dc_vnet_alloc` ADD CONSTRAINT UNIQUE `i_op_dc_vnet_alloc__vnet__data_center_id`(`vnet`, `physical_network_id`, `data_center_id`);
253253

254+
ALTER TABLE `cloud`.`op_dc_vnet_alloc` DROP INDEX i_op_dc_vnet_alloc__vnet__data_center_id__account_id;
255+
254256
CREATE TABLE `cloud`.`region` (
255257
`id` int unsigned NOT NULL UNIQUE,
256258
`name` varchar(255) NOT NULL UNIQUE,

0 commit comments

Comments
 (0)