You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2018/03/29 13:39:21 UTC

[GitHub] rafaelweingartner closed pull request #2492: Fix the name of the column used to hold IPv4 range in 'vlan' table.

rafaelweingartner closed pull request #2492: Fix the name of the column used to hold IPv4 range in 'vlan' table.
URL: https://github.com/apache/cloudstack/pull/2492
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/engine/schema/src/main/java/com/cloud/dc/VlanVO.java b/engine/schema/src/main/java/com/cloud/dc/VlanVO.java
index 50106e07fc9..ebbd4bde08b 100644
--- a/engine/schema/src/main/java/com/cloud/dc/VlanVO.java
+++ b/engine/schema/src/main/java/com/cloud/dc/VlanVO.java
@@ -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.Id;
 import javax.persistence.Table;
 
+import com.cloud.utils.db.GenericDao;
+
 @Entity
 @Table(name = "vlan")
 public class VlanVO implements Vlan {
@@ -57,7 +57,7 @@
     @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 void setPhysicalNetworkId(Long physicalNetworkId) {
     public String toString() {
         if (toString == null) {
             toString =
-                new StringBuilder("Vlan[").append(vlanTag)
+                    new StringBuilder("Vlan[").append(vlanTag)
                     .append("|")
                     .append(vlanGateway)
                     .append("|")
diff --git a/engine/schema/src/main/resources/META-INF/db/schema-41100to41200.sql b/engine/schema/src/main/resources/META-INF/db/schema-41100to41200.sql
index 97bd5ae7aae..90f3f11f759 100644
--- a/engine/schema/src/main/resources/META-INF/db/schema-41100to41200.sql
+++ b/engine/schema/src/main/resources/META-INF/db/schema-41100to41200.sql
@@ -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);
\ No newline at end of file
diff --git a/server/src/main/java/com/cloud/test/PodZoneConfig.java b/server/src/main/java/com/cloud/test/PodZoneConfig.java
index c55178f3f79..3607a3b1fff 100644
--- a/server/src/main/java/com/cloud/test/PodZoneConfig.java
+++ b/server/src/main/java/com/cloud/test/PodZoneConfig.java
@@ -485,7 +485,7 @@ public void deleteZone(String name) {
     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.");


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services