Fix the name of the column used to hold IPv4 range in 'vlan' table. (#2492)

This commit is contained in:
Rafael Weingärtner 2018-03-29 10:39:19 -03:00 committed by GitHub
parent 36f4645154
commit 3868886546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -16,8 +16,6 @@
// under the License.
package com.cloud.dc;
import com.cloud.utils.db.GenericDao;
import java.util.Date;
import java.util.UUID;
@ -30,6 +28,8 @@ import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import com.cloud.utils.db.GenericDao;
@Entity
@Table(name = "vlan")
public class VlanVO implements Vlan {
@ -57,7 +57,7 @@ public class VlanVO implements Vlan {
@Column(name = "data_center_id")
long dataCenterId;
@Column(name = "description")
@Column(name = "ip4_range")
String ipRange;
@Column(name = "ip6_range")
@ -185,7 +185,7 @@ public class VlanVO implements Vlan {
public String toString() {
if (toString == null) {
toString =
new StringBuilder("Vlan[").append(vlanTag)
new StringBuilder("Vlan[").append(vlanTag)
.append("|")
.append(vlanGateway)
.append("|")

View File

@ -22,5 +22,8 @@
-- [CLOUDSTACK-10314] Add reason column to ACL rule table
ALTER TABLE `cloud`.`network_acl_item` ADD COLUMN `reason` VARCHAR(2500) AFTER `display`;
--[CLOUDSTACK-9846] Make provision to store content and subject for Alerts in separate columns.
-- [CLOUDSTACK-9846] Make provision to store content and subject for Alerts in separate columns.
ALTER TABLE `cloud`.`alert` ADD COLUMN `content` VARCHAR(5000);
-- Fix the name of the column used to hold IPv4 range in 'vlan' table.
ALTER TABLE `vlan` CHANGE `description` `ip4_range` varchar(255);

View File

@ -485,7 +485,7 @@ public class PodZoneConfig {
public void saveVlan(long zoneId, Long podId, String vlanId, String vlanGateway, String vlanNetmask, String vlanType, String ipRange, long networkId,
long physicalNetworkId) {
String sql =
"INSERT INTO `cloud`.`vlan` (vlan_id, vlan_gateway, vlan_netmask, data_center_id, vlan_type, description, network_id, physical_network_id) " + "VALUES ('" +
"INSERT INTO `cloud`.`vlan` (vlan_id, vlan_gateway, vlan_netmask, data_center_id, vlan_type, ip4_range, network_id, physical_network_id) " + "VALUES ('" +
vlanId + "','" + vlanGateway + "','" + vlanNetmask + "','" + zoneId + "','" + vlanType + "','" + ipRange + "','" + networkId + "','" + physicalNetworkId +
"')";
DatabaseConfig.saveSQL(sql, "Failed to save vlan due to exception. Please contact Cloud Support.");