|
19 | 19 | -- Schema upgrade from 4.18.1.0 to 4.19.0.0 |
20 | 20 | --; |
21 | 21 |
|
| 22 | +ALTER TABLE `cloud`.`mshost` MODIFY COLUMN `state` varchar(25); |
| 23 | + |
| 24 | +DROP VIEW IF EXISTS `cloud`.`async_job_view`; |
| 25 | +CREATE VIEW `cloud`.`async_job_view` AS |
| 26 | + select |
| 27 | + account.id account_id, |
| 28 | + account.uuid account_uuid, |
| 29 | + account.account_name account_name, |
| 30 | + account.type account_type, |
| 31 | + domain.id domain_id, |
| 32 | + domain.uuid domain_uuid, |
| 33 | + domain.name domain_name, |
| 34 | + domain.path domain_path, |
| 35 | + user.id user_id, |
| 36 | + user.uuid user_uuid, |
| 37 | + async_job.id, |
| 38 | + async_job.uuid, |
| 39 | + async_job.job_cmd, |
| 40 | + async_job.job_status, |
| 41 | + async_job.job_process_status, |
| 42 | + async_job.job_result_code, |
| 43 | + async_job.job_result, |
| 44 | + async_job.created, |
| 45 | + async_job.removed, |
| 46 | + async_job.instance_type, |
| 47 | + async_job.instance_id, |
| 48 | + async_job.job_executing_msid, |
| 49 | + CASE |
| 50 | + WHEN async_job.instance_type = 'Volume' THEN volumes.uuid |
| 51 | + WHEN |
| 52 | + async_job.instance_type = 'Template' |
| 53 | + or async_job.instance_type = 'Iso' |
| 54 | + THEN |
| 55 | + vm_template.uuid |
| 56 | + WHEN |
| 57 | + async_job.instance_type = 'VirtualMachine' |
| 58 | + or async_job.instance_type = 'ConsoleProxy' |
| 59 | + or async_job.instance_type = 'SystemVm' |
| 60 | + or async_job.instance_type = 'DomainRouter' |
| 61 | + THEN |
| 62 | + vm_instance.uuid |
| 63 | + WHEN async_job.instance_type = 'Snapshot' THEN snapshots.uuid |
| 64 | + WHEN async_job.instance_type = 'Host' THEN host.uuid |
| 65 | + WHEN async_job.instance_type = 'StoragePool' THEN storage_pool.uuid |
| 66 | + WHEN async_job.instance_type = 'IpAddress' THEN user_ip_address.uuid |
| 67 | + WHEN async_job.instance_type = 'SecurityGroup' THEN security_group.uuid |
| 68 | + WHEN async_job.instance_type = 'PhysicalNetwork' THEN physical_network.uuid |
| 69 | + WHEN async_job.instance_type = 'TrafficType' THEN physical_network_traffic_types.uuid |
| 70 | + WHEN async_job.instance_type = 'PhysicalNetworkServiceProvider' THEN physical_network_service_providers.uuid |
| 71 | + WHEN async_job.instance_type = 'FirewallRule' THEN firewall_rules.uuid |
| 72 | + WHEN async_job.instance_type = 'Account' THEN acct.uuid |
| 73 | + WHEN async_job.instance_type = 'User' THEN us.uuid |
| 74 | + WHEN async_job.instance_type = 'StaticRoute' THEN static_routes.uuid |
| 75 | + WHEN async_job.instance_type = 'PrivateGateway' THEN vpc_gateways.uuid |
| 76 | + WHEN async_job.instance_type = 'Counter' THEN counter.uuid |
| 77 | + WHEN async_job.instance_type = 'Condition' THEN conditions.uuid |
| 78 | + WHEN async_job.instance_type = 'AutoScalePolicy' THEN autoscale_policies.uuid |
| 79 | + WHEN async_job.instance_type = 'AutoScaleVmProfile' THEN autoscale_vmprofiles.uuid |
| 80 | + WHEN async_job.instance_type = 'AutoScaleVmGroup' THEN autoscale_vmgroups.uuid |
| 81 | + ELSE null |
| 82 | + END instance_uuid |
| 83 | + from |
| 84 | + `cloud`.`async_job` |
| 85 | + left join |
| 86 | + `cloud`.`account` ON async_job.account_id = account.id |
| 87 | + left join |
| 88 | + `cloud`.`domain` ON domain.id = account.domain_id |
| 89 | + left join |
| 90 | + `cloud`.`user` ON async_job.user_id = user.id |
| 91 | + left join |
| 92 | + `cloud`.`volumes` ON async_job.instance_id = volumes.id |
| 93 | + left join |
| 94 | + `cloud`.`vm_template` ON async_job.instance_id = vm_template.id |
| 95 | + left join |
| 96 | + `cloud`.`vm_instance` ON async_job.instance_id = vm_instance.id |
| 97 | + left join |
| 98 | + `cloud`.`snapshots` ON async_job.instance_id = snapshots.id |
| 99 | + left join |
| 100 | + `cloud`.`host` ON async_job.instance_id = host.id |
| 101 | + left join |
| 102 | + `cloud`.`storage_pool` ON async_job.instance_id = storage_pool.id |
| 103 | + left join |
| 104 | + `cloud`.`user_ip_address` ON async_job.instance_id = user_ip_address.id |
| 105 | + left join |
| 106 | + `cloud`.`security_group` ON async_job.instance_id = security_group.id |
| 107 | + left join |
| 108 | + `cloud`.`physical_network` ON async_job.instance_id = physical_network.id |
| 109 | + left join |
| 110 | + `cloud`.`physical_network_traffic_types` ON async_job.instance_id = physical_network_traffic_types.id |
| 111 | + left join |
| 112 | + `cloud`.`physical_network_service_providers` ON async_job.instance_id = physical_network_service_providers.id |
| 113 | + left join |
| 114 | + `cloud`.`firewall_rules` ON async_job.instance_id = firewall_rules.id |
| 115 | + left join |
| 116 | + `cloud`.`account` acct ON async_job.instance_id = acct.id |
| 117 | + left join |
| 118 | + `cloud`.`user` us ON async_job.instance_id = us.id |
| 119 | + left join |
| 120 | + `cloud`.`static_routes` ON async_job.instance_id = static_routes.id |
| 121 | + left join |
| 122 | + `cloud`.`vpc_gateways` ON async_job.instance_id = vpc_gateways.id |
| 123 | + left join |
| 124 | + `cloud`.`counter` ON async_job.instance_id = counter.id |
| 125 | + left join |
| 126 | + `cloud`.`conditions` ON async_job.instance_id = conditions.id |
| 127 | + left join |
| 128 | + `cloud`.`autoscale_policies` ON async_job.instance_id = autoscale_policies.id |
| 129 | + left join |
| 130 | + `cloud`.`autoscale_vmprofiles` ON async_job.instance_id = autoscale_vmprofiles.id |
| 131 | + left join |
| 132 | + `cloud`.`autoscale_vmgroups` ON async_job.instance_id = autoscale_vmgroups.id; |
| 133 | + |
0 commit comments