Skip to content

Commit 0de5eb2

Browse files
committed
db changes for the schema
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent e9aeb72 commit 0de5eb2

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

engine/schema/src/main/resources/META-INF/db/schema-41200to41300.sql

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,45 @@
1919
-- Schema upgrade from 4.12.0.0 to 4.13.0.0
2020
--;
2121

22+
-- Add `sort_key` column to data_center
23+
ALTER TABLE `cloud`.`data_center` ADD COLUMN `sort_key` INT(32) NOT NULL DEFAULT 0;
24+
25+
-- Recreate data_center_view
26+
DROP VIEW IF EXISTS `cloud`.`data_center_view`;
27+
CREATE VIEW `cloud`.`data_center_view` AS
28+
select
29+
data_center.id,
30+
data_center.uuid,
31+
data_center.name,
32+
data_center.is_security_group_enabled,
33+
data_center.is_local_storage_enabled,
34+
data_center.description,
35+
data_center.dns1,
36+
data_center.dns2,
37+
data_center.ip6_dns1,
38+
data_center.ip6_dns2,
39+
data_center.internal_dns1,
40+
data_center.internal_dns2,
41+
data_center.guest_network_cidr,
42+
data_center.domain,
43+
data_center.networktype,
44+
data_center.allocation_state,
45+
data_center.zone_token,
46+
data_center.dhcp_provider,
47+
data_center.removed,
48+
data_center.sort_key,
49+
domain.id domain_id,
50+
domain.uuid domain_uuid,
51+
domain.name domain_name,
52+
domain.path domain_path,
53+
dedicated_resources.affinity_group_id,
54+
dedicated_resources.account_id,
55+
affinity_group.uuid affinity_group_uuid
56+
from
57+
`cloud`.`data_center`
58+
left join
59+
`cloud`.`domain` ON data_center.domain_id = domain.id
60+
left join
61+
`cloud`.`dedicated_resources` ON data_center.id = dedicated_resources.data_center_id
62+
left join
63+
`cloud`.`affinity_group` ON dedicated_resources.affinity_group_id = affinity_group.id;

0 commit comments

Comments
 (0)