Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

import javax.inject.Inject;

import com.cloud.upgrade.dao.Upgrade42210to42220;
import com.cloud.utils.FileUtil;
import org.apache.cloudstack.utils.CloudStackVersion;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -246,6 +247,7 @@ public DatabaseUpgradeChecker() {
.next("4.20.4.0", new Upgrade42040to42100())
.next("4.21.0.0", new Upgrade42100to42200())
.next("4.22.0.0", new Upgrade42200to42210())
.next("4.22.1.0", new Upgrade42210to42220())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package com.cloud.upgrade.dao;

public class Upgrade42210to42220 extends DbUpgradeAbstractImpl implements DbUpgrade, DbUpgradeSystemVmTemplate {

@Override
public String[] getUpgradableVersionRange() {
return new String[] {"4.22.1.0", "4.22.2.0"};
}

@Override
public String getUpgradedVersion() {
return "4.22.2.0";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,8 @@
-- specific language governing permissions and limitations
-- under the License.

-- cloud.account_netstats_view source

--;
-- Schema upgrade cleanup from 4.22.1.0 to 4.22.2.0
--;

DROP VIEW IF EXISTS `cloud`.`account_netstats_view`;

CREATE VIEW `cloud`.`account_netstats_view` AS
select
`user_statistics`.`account_id` AS `account_id`,
(sum(`user_statistics`.`net_bytes_received`) + sum(`user_statistics`.`current_bytes_received`)) AS `bytesReceived`,
(sum(`user_statistics`.`net_bytes_sent`) + sum(`user_statistics`.`current_bytes_sent`)) AS `bytesSent`
from
`user_statistics`
group by
`user_statistics`.`account_id`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may not use this file except in compliance
-- with the License. You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing,
-- software distributed under the License is distributed on an
-- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-- KIND, either express or implied. See the License for the
-- specific language governing permissions and limitations
-- under the License.

--;
-- Schema upgrade from 4.22.1.0 to 4.22.2.0
--;

Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ select
`data_center`.`id` AS `data_center_id`,
`data_center`.`uuid` AS `data_center_uuid`,
`data_center`.`name` AS `data_center_name`,
`account_netstats_view`.`bytesReceived` AS `bytesReceived`,
`account_netstats_view`.`bytesSent` AS `bytesSent`,
(SELECT COALESCE(SUM(`us`.`net_bytes_received` + `us`.`current_bytes_received`), 0) FROM `cloud`.`user_statistics` `us` WHERE `us`.`account_id` = `account`.`id`) AS `bytesReceived`,
(SELECT COALESCE(SUM(`us`.`net_bytes_sent` + `us`.`current_bytes_sent`), 0) FROM `cloud`.`user_statistics` `us` WHERE `us`.`account_id` = `account`.`id`) AS `bytesSent`,
`vmlimit`.`max` AS `vmLimit`,
`vmcount`.`count` AS `vmTotal`,
`runningvm`.`vmcount` AS `runningVms`,
Expand Down
Loading