Skip to content

Commit fdc41e5

Browse files
DaanHooglanddhslove
authored andcommitted
field enlarged and db upgrade (apache#8675)
* 4.19 -> 4.19.1 and enlarge url field
1 parent 3a5a8ec commit fdc41e5

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

engine/schema/src/main/java/com/cloud/upgrade/dao/Upgrade41900to41910.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.upgrade.dao;
1818

19+
import org.apache.log4j.Logger;
20+
1921
import com.cloud.upgrade.SystemVmTemplateRegistration;
2022
import com.cloud.utils.exception.CloudRuntimeException;
2123

@@ -71,6 +73,10 @@ private void addIndexes(Connection conn) {
7173
DbUpgradeUtils.addIndexIfNeeded(conn, "vm_stats", "vm_id");
7274
}
7375

76+
private void initSystemVmTemplateRegistration() {
77+
systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
78+
}
79+
7480
@Override
7581
public void updateSystemVmTemplates(Connection conn) {
7682
logger.debug("Updating System Vm template IDs");
@@ -81,8 +87,4 @@ public void updateSystemVmTemplates(Connection conn) {
8187
throw new CloudRuntimeException("Failed to find / register SystemVM template(s)");
8288
}
8389
}
84-
85-
private void initSystemVmTemplateRegistration() {
86-
systemVmTemplateRegistration = new SystemVmTemplateRegistration("");
87-
}
8890
}

engine/schema/src/main/resources/META-INF/db/schema-41900to41910.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ SET usage_unit = 'IOPS', updated_on = NOW()
3131
WHERE effective_on = '2010-05-04 00:00:00'
3232
AND name IN ('VM_DISK_IO_READ', 'VM_DISK_IO_WRITE');
3333

34+
-- allow for bigger urls
35+
36+
ALTER TABLE `cloud`.`vm_template` MODIFY COLUMN `url` VARCHAR(1024) DEFAULT NULL COMMENT 'the url where the template exists externally';
37+
3438
-- PR #7235 - [Usage] Create VPC billing
3539
CREATE TABLE IF NOT EXISTS `cloud_usage`.`usage_vpc` (
3640
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,

0 commit comments

Comments
 (0)