Skip to content

Commit 3201158

Browse files
author
Daan Hoogland
committed
move db upgrade to 4.17
1 parent f646d34 commit 3201158

2 files changed

Lines changed: 49 additions & 48 deletions

File tree

engine/schema/src/main/resources/META-INF/db/schema-41520to41600.sql

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -805,50 +805,3 @@ ALTER TABLE cloud.user_vm_details MODIFY value varchar(5120) NOT NULL;
805805
ALTER TABLE cloud_usage.usage_network DROP PRIMARY KEY, ADD PRIMARY KEY (`account_id`,`zone_id`,`host_id`,`network_id`,`event_time_millis`);
806806
ALTER TABLE `cloud`.`user_statistics` DROP INDEX `account_id`, ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`,`public_ip_address`,`device_id`,`device_type`, `network_id`);
807807
ALTER TABLE `cloud_usage`.`user_statistics` DROP INDEX `account_id`, ADD UNIQUE KEY `account_id` (`account_id`,`data_center_id`,`public_ip_address`,`device_id`,`device_type`, `network_id`);
808-
809-
-- Management Server Status
810-
ALTER TABLE cloud.mshost ADD CONSTRAINT mshost_UUID UNIQUE KEY (uuid);
811-
CREATE TABLE `mshost_status` (
812-
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
813-
`ms_id` varchar(40) DEFAULT NULL COMMENT 'the uuid of the management server record',
814-
`last_start` datetime DEFAULT NULL COMMENT 'the last start time for this MS',
815-
`last_stop` datetime DEFAULT NULL COMMENT 'the last stop time for this MS',
816-
`last_boot` datetime DEFAULT NULL COMMENT 'the last system boot time for the host of this MS',
817-
`last_down` datetime DEFAULT NULL COMMENT 'the last system shutdown time for the host of this MS',
818-
`os_distribution` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'the name of the os type running on the host of this MS',
819-
`java_name` varchar(64) DEFAULT NULL COMMENT 'the name of the java distribution running this MS',
820-
`java_version` varchar(64) DEFAULT NULL COMMENT 'the version of the java distribution running this MS',
821-
`updated` datetime DEFAULT NULL,
822-
`created` datetime DEFAULT NULL,
823-
`removed` datetime DEFAULT NULL,
824-
PRIMARY KEY (`id`),
825-
CONSTRAINT `uc_ms_id` UNIQUE (`ms_id`),
826-
CONSTRAINT `mshost_status_FK` FOREIGN KEY (`ms_id`) REFERENCES `mshost` (`uuid`)
827-
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;
828-
829-
DROP VIEW IF EXISTS `cloud`.`mshost_view`;
830-
CREATE VIEW `cloud`.`mshost_view` AS
831-
select
832-
`cloud`.`mshost`.`id` AS `id`,
833-
`cloud`.`mshost`.`msid` AS `msid`,
834-
`cloud`.`mshost`.`runid` AS `runid`,
835-
`cloud`.`mshost`.`name` AS `name`,
836-
`cloud`.`mshost`.`uuid` AS `uuid`,
837-
`cloud`.`mshost`.`state` AS `state`,
838-
`cloud`.`mshost`.`version` AS `version`,
839-
`cloud`.`mshost`.`service_ip` AS `service_ip`,
840-
`cloud`.`mshost`.`service_port` AS `service_port`,
841-
`cloud`.`mshost`.`last_update` AS `last_update`,
842-
`cloud`.`mshost`.`removed` AS `removed`,
843-
`cloud`.`mshost`.`alert_count` AS `alert_count`,
844-
`cloud`.`mshost_status`.`last_start` AS `last_start`,
845-
`cloud`.`mshost_status`.`last_stop` AS `last_stop`,
846-
`cloud`.`mshost_status`.`last_boot` AS `last_boot`,
847-
`cloud`.`mshost_status`.`last_down` AS `last_down`,
848-
`cloud`.`mshost_status`.`os_distribution` AS `os_distribution`,
849-
`cloud`.`mshost_status`.`java_name` AS `java_name`,
850-
`cloud`.`mshost_status`.`java_version` AS `java_version`
851-
from
852-
(`cloud`.`mshost`
853-
left join `cloud`.`mshost_status` on
854-
((`cloud`.`mshost`.`uuid` = `cloud`.`mshost_status`.`ms_id`)))

engine/schema/src/main/resources/META-INF/db/schema-41610to41700.sql

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,52 @@
1717

1818
--;
1919
-- Schema upgrade from 4.16.1.0 to 4.17.0.0
20-
--;
20+
--;
21+
22+
23+
-- Management Server Status
24+
ALTER TABLE `cloud`.`mshost` ADD CONSTRAINT `mshost_UUID` UNIQUE KEY (`uuid`);
25+
CREATE TABLE `cloud`.`mshost_status` (
26+
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
27+
`ms_id` varchar(40) DEFAULT NULL COMMENT 'the uuid of the management server record',
28+
`last_start` datetime DEFAULT NULL COMMENT 'the last start time for this MS',
29+
`last_stop` datetime DEFAULT NULL COMMENT 'the last stop time for this MS',
30+
`last_boot` datetime DEFAULT NULL COMMENT 'the last system boot time for the host of this MS',
31+
`last_down` datetime DEFAULT NULL COMMENT 'the last system shutdown time for the host of this MS',
32+
`os_distribution` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'the name of the os type running on the host of this MS',
33+
`java_name` varchar(64) DEFAULT NULL COMMENT 'the name of the java distribution running this MS',
34+
`java_version` varchar(64) DEFAULT NULL COMMENT 'the version of the java distribution running this MS',
35+
`updated` datetime DEFAULT NULL,
36+
`created` datetime DEFAULT NULL,
37+
`removed` datetime DEFAULT NULL,
38+
PRIMARY KEY (`id`),
39+
CONSTRAINT `uc_ms_id` UNIQUE (`ms_id`),
40+
CONSTRAINT `mshost_status_FK` FOREIGN KEY (`ms_id`) REFERENCES `mshost` (`uuid`)
41+
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb3;
42+
43+
DROP VIEW IF EXISTS `cloud`.`mshost_view`;
44+
CREATE VIEW `cloud`.`mshost_view` AS
45+
select
46+
`cloud`.`mshost`.`id` AS `id`,
47+
`cloud`.`mshost`.`msid` AS `msid`,
48+
`cloud`.`mshost`.`runid` AS `runid`,
49+
`cloud`.`mshost`.`name` AS `name`,
50+
`cloud`.`mshost`.`uuid` AS `uuid`,
51+
`cloud`.`mshost`.`state` AS `state`,
52+
`cloud`.`mshost`.`version` AS `version`,
53+
`cloud`.`mshost`.`service_ip` AS `service_ip`,
54+
`cloud`.`mshost`.`service_port` AS `service_port`,
55+
`cloud`.`mshost`.`last_update` AS `last_update`,
56+
`cloud`.`mshost`.`removed` AS `removed`,
57+
`cloud`.`mshost`.`alert_count` AS `alert_count`,
58+
`cloud`.`mshost_status`.`last_start` AS `last_start`,
59+
`cloud`.`mshost_status`.`last_stop` AS `last_stop`,
60+
`cloud`.`mshost_status`.`last_boot` AS `last_boot`,
61+
`cloud`.`mshost_status`.`last_down` AS `last_down`,
62+
`cloud`.`mshost_status`.`os_distribution` AS `os_distribution`,
63+
`cloud`.`mshost_status`.`java_name` AS `java_name`,
64+
`cloud`.`mshost_status`.`java_version` AS `java_version`
65+
from
66+
(`cloud`.`mshost`
67+
left join `cloud`.`mshost_status` on
68+
((`cloud`.`mshost`.`uuid` = `cloud`.`mshost_status`.`ms_id`)));

0 commit comments

Comments
 (0)