Skip to content

Commit 49abb29

Browse files
committed
fix db schema after rebase
1 parent d36f15a commit 49abb29

File tree

5 files changed

+10
-9
lines changed

5 files changed

+10
-9
lines changed

engine/schema/src/main/java/com/cloud/upgrade/DatabaseUpgradeChecker.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
import com.cloud.upgrade.dao.Upgrade41900to41910;
9090
import com.cloud.upgrade.dao.Upgrade41910to42000;
9191
import com.cloud.upgrade.dao.Upgrade42000to42010;
92+
import com.cloud.upgrade.dao.Upgrade42010to42020;
9293
import com.cloud.upgrade.dao.Upgrade420to421;
9394
import com.cloud.upgrade.dao.Upgrade421to430;
9495
import com.cloud.upgrade.dao.Upgrade430to440;
@@ -232,6 +233,7 @@ public DatabaseUpgradeChecker() {
232233
.next("4.19.0.0", new Upgrade41900to41910())
233234
.next("4.19.1.0", new Upgrade41910to42000())
234235
.next("4.20.0.0", new Upgrade42000to42010())
236+
.next("4.20.1.0", new Upgrade42010to42020())
235237
.build();
236238
}
237239

engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41930to41940.java renamed to engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade42010to42020.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@
2121

2222
import com.cloud.utils.exception.CloudRuntimeException;
2323

24-
public class Upgrade41930to41940 implements DbUpgrade {
24+
public class Upgrade42010to42020 implements DbUpgrade {
2525

2626
@Override
2727
public String[] getUpgradableVersionRange() {
28-
return new String[]{"4.19.3.0", "4.19.4.0"};
28+
return new String[]{"4.20.1.0", "4.20.2.0"};
2929
}
3030

3131
@Override
3232
public String getUpgradedVersion() {
33-
return "4.19.4.0";
33+
return "4.20.2.0";
3434
}
3535

3636
@Override
@@ -40,7 +40,7 @@ public boolean supportsRollingUpgrade() {
4040

4141
@Override
4242
public InputStream[] getPrepareScripts() {
43-
final String scriptFile = "META-INF/db/schema-41930to41940.sql";
43+
final String scriptFile = "META-INF/db/schema-42010to42020.sql";
4444
final InputStream script = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptFile);
4545
if (script == null) {
4646
throw new CloudRuntimeException("Unable to find " + scriptFile);

engine/schema/src/main/java/com/cloud/usage/dao/UsageVolumeDaoImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import javax.annotation.PostConstruct;
2828

29-
import org.apache.log4j.Logger;
3029
import org.springframework.stereotype.Component;
3130

3231
import com.cloud.usage.UsageVolumeVO;

engine/schema/src/main/resources/META-INF/db/schema-41930to41940.sql renamed to engine/schema/src/main/resources/META-INF/db/schema-42010to42020.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
-- under the License.
1717

1818
--;
19-
-- Schema upgrade from 4.19.3.0 to 4.19.4.0
19+
-- Schema upgrade from 4.20.1.0 to 4.20.2.0
2020
--;
2121

2222
-- Add vm_id column to usage_event table for volume usage events

usage/src/main/java/com/cloud/usage/UsageManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ private void createIPHelperEvent(UsageEventVO event) {
15461546
private void deleteExistingSecondaryStorageUsageForVolume(long volId, long accountId, Date deletedDate) {
15471547
List<UsageStorageVO> storageVOs = _usageStorageDao.listById(accountId, volId, StorageTypes.VOLUME);
15481548
for (UsageStorageVO storageVO : storageVOs) {
1549-
s_logger.debug(String.format("Setting the volume with id: {} to 'deleted' in the usage_storage table for account: {}.", volId, accountId));
1549+
logger.debug(String.format("Setting the volume with id: {} to 'deleted' in the usage_storage table for account: {}.", volId, accountId));
15501550
storageVO.setDeleted(deletedDate);
15511551
_usageStorageDao.update(storageVO);
15521552
}
@@ -1556,7 +1556,7 @@ private void deleteExistingInstanceVolumeUsage(long volId, long accountId, Date
15561556
List<UsageVolumeVO> volumesVOs = _usageVolumeDao.listByVolumeId(volId, accountId);
15571557
for (UsageVolumeVO volumesVO : volumesVOs) {
15581558
if (volumesVO.getVmId() != null) {
1559-
s_logger.debug(String.format("Setting the volume with id: {} for instance id: {} to 'deleted' in the usage_volume table for account {}.",
1559+
logger.debug(String.format("Setting the volume with id: {} for instance id: {} to 'deleted' in the usage_volume table for account {}.",
15601560
volumesVO.getVolumeId(), volumesVO.getVmId(), accountId));
15611561
volumesVO.setDeleted(deletedDate);
15621562
_usageVolumeDao.update(volumesVO.getId(), volumesVO);
@@ -1567,7 +1567,7 @@ private void deleteExistingInstanceVolumeUsage(long volId, long accountId, Date
15671567
private void deleteExistingVolumeUsage(long volId, long accountId, Date deletedDate) {
15681568
List<UsageVolumeVO> volumesVOs = _usageVolumeDao.listByVolumeId(volId, accountId);
15691569
for (UsageVolumeVO volumesVO : volumesVOs) {
1570-
s_logger.debug(String.format("Setting the volume with id: {} to 'deleted' in the usage_storage table for account: {}.", volId, accountId));
1570+
logger.debug(String.format("Setting the volume with id: {} to 'deleted' in the usage_storage table for account: {}.", volId, accountId));
15711571
volumesVO.setDeleted(deletedDate);
15721572
_usageVolumeDao.update(volumesVO.getId(), volumesVO);
15731573
}

0 commit comments

Comments
 (0)