increase wrt_vlans field length in DB VST rule
authorAlexey Andriyanov <alan@al-an.info>
Sun, 20 Apr 2014 08:41:55 +0000 (12:41 +0400)
committerAlexey Andriyanov <alan@al-an.info>
Sun, 20 Apr 2014 08:54:11 +0000 (12:54 +0400)
There could be a VLAN list longer than 255 characters
in some environments.

wwwroot/inc/install.php
wwwroot/inc/upgrade.php

index 7bb0b59c675b8b3b80b634cad38dceb2ef472bed..8e367dd917bc592d882f8c1dacf45201963aa251 100644 (file)
@@ -1072,7 +1072,7 @@ function get_pseudo_file ($name)
   `rule_no` int(10) unsigned NOT NULL,
   `port_pcre` char(255) NOT NULL,
   `port_role` enum('access','trunk','anymode','uplink','downlink','none') NOT NULL default 'none',
-  `wrt_vlans` char(255) default NULL,
+  `wrt_vlans` text,
   `description` char(255) default NULL,
   UNIQUE KEY `vst-rule` (`vst_id`,`rule_no`),
   CONSTRAINT `VLANSTRule-FK-vst_id` FOREIGN KEY (`vst_id`) REFERENCES `VLANSwitchTemplate` (`id`) ON DELETE CASCADE
index ce0f44d0e778115b1397b5eaa4d8e2e9947ee4e1..5da9fd2a88a51270433622579a8a2dc1097e1f86 100644 (file)
@@ -263,6 +263,7 @@ function getDBUpgradePath ($v1, $v2)
                '0.20.5',
                '0.20.6',
                '0.20.7',
+               '0.21.0',
        );
        if (!in_array ($v1, $versionhistory) or !in_array ($v2, $versionhistory))
                return NULL;
@@ -1605,6 +1606,11 @@ ENDOFTRIGGER;
 
                        $query[] = "UPDATE Config SET varvalue = '0.20.7' WHERE varname = 'DB_VERSION'";
                        break;
+               case '0.21.0':
+                       $query[] = "ALTER TABLE `VLANSTRule` CHANGE COLUMN `wrt_vlans` `wrt_vlans` text";
+
+                       $query[] = "UPDATE Config SET varvalue = '0.21.0' WHERE varname = 'DB_VERSION'";
+                       break;
                case 'dictionary':
                        $query = reloadDictionary();
                        break;