Skip to content
Draft
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 @@ -92,6 +92,7 @@
import com.cloud.upgrade.dao.Upgrade42010to42100;
import com.cloud.upgrade.dao.Upgrade42100to42200;
import com.cloud.upgrade.dao.Upgrade42200to42210;
import com.cloud.upgrade.dao.Upgrade42210to42220;
import com.cloud.upgrade.dao.Upgrade420to421;
import com.cloud.upgrade.dao.Upgrade421to430;
import com.cloud.upgrade.dao.Upgrade430to440;
Expand Down Expand Up @@ -242,6 +243,7 @@ public DatabaseUpgradeChecker() {
.next("4.20.1.0", new Upgrade42010to42100())
.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,49 @@
// 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;

import com.cloud.utils.exception.CloudRuntimeException;

import java.io.InputStream;
import java.sql.Connection;

public class Upgrade42210to42220 extends DbUpgradeAbstractImpl implements DbUpgrade {

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

Check warning on line 28 in engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42220.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure using this hardcoded IP address is safe here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AZ6o6h5YBCpoD8zHzUlF&open=AZ6o6h5YBCpoD8zHzUlF&pullRequest=13380

Check warning on line 28 in engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42220.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure using this hardcoded IP address is safe here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AZ6o6h5YBCpoD8zHzUlG&open=AZ6o6h5YBCpoD8zHzUlG&pullRequest=13380

Check notice

Code scanning / SonarCloud

IP addresses should not be hardcoded Low

Make sure using this hardcoded IP address is safe here. See more on SonarQube Cloud

Check notice

Code scanning / SonarCloud

IP addresses should not be hardcoded Low

Make sure using this hardcoded IP address is safe here. See more on SonarQube Cloud
}

@Override
public String getUpgradedVersion() {
return "4.22.2.0";

Check warning on line 33 in engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42220.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make sure using this hardcoded IP address is safe here.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AZ6o6h5YBCpoD8zHzUlH&open=AZ6o6h5YBCpoD8zHzUlH&pullRequest=13380

Check notice

Code scanning / SonarCloud

IP addresses should not be hardcoded Low

Make sure using this hardcoded IP address is safe here. See more on SonarQube Cloud
}

@Override
public InputStream[] getPrepareScripts() {
final String scriptFile = "META-INF/db/schema-42210to42220.sql";
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
if (script == null) {
throw new CloudRuntimeException("Unable to find " + scriptFile);
}
return new InputStream[] {script};
}

@Override
public void performDataMigration(Connection conn) {

Check failure on line 47 in engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42210to42220.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add a nested comment explaining why this method is empty, throw an UnsupportedOperationException or complete the implementation.

See more on https://sonarcloud.io/project/issues?id=apache_cloudstack&issues=AZ6o6h5YBCpoD8zHzUlI&open=AZ6o6h5YBCpoD8zHzUlI&pullRequest=13380
}
}
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.

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

-- Change nw_rate and mc_rate column types from smallint unsigned to int unsigned
-- to align with the Java Integer type and support larger rate values
ALTER TABLE `cloud`.`service_offering`
MODIFY COLUMN `nw_rate` int unsigned DEFAULT 200 COMMENT 'network rate throttle mbits/s',
MODIFY COLUMN `mc_rate` int unsigned DEFAULT 10 COMMENT 'mcast rate throttle mbits/s';

ALTER TABLE `cloud`.`network_offerings`
MODIFY COLUMN `nw_rate` int unsigned COMMENT 'network rate throttle mbits/s',
MODIFY COLUMN `mc_rate` int unsigned COMMENT 'mcast rate throttle mbits/s';
Loading