Commit e21bb150 authored by Leigh B Stoller's avatar Leigh B Stoller

Add switchpath to vlans table for storing the assign computed switch

path after snmpit creates the vlans. We need this in the vlans table
because of swapmod and syncVlansFromTables(), since the contents of
the lans table may not reflect what is on the switches, and we need to
know precisely what switch trunks have been setup.
parent 5535b1a7
......@@ -1857,7 +1857,7 @@ DROP TABLE IF EXISTS `lan_attributes`;
CREATE TABLE `lan_attributes` (
`lanid` int(11) NOT NULL default '0',
`attrkey` varchar(32) NOT NULL default '',
`attrvalue` tinytext NOT NULL,
`attrvalue` text NOT NULL,
`attrtype` enum('integer','float','boolean','string') default 'string',
PRIMARY KEY (`lanid`,`attrkey`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......@@ -4606,6 +4606,7 @@ CREATE TABLE `vlans` (
`pid` varchar(48) NOT NULL default '',
`virtual` varchar(64) default NULL,
`members` text NOT NULL,
`switchpath` text default NULL,
`id` int(11) NOT NULL auto_increment,
`tag` smallint(5) NOT NULL default '0',
`stack` varchar(32) default NULL,
......
#
# Add switch path to vlans.
#
use strict;
use libdb;
sub DoUpdate($$$)
{
my ($dbhandle, $dbname, $version) = @_;
# A space separated list of switch pairs. ie: "sw1:sw2 sw2:sw3 ..."
if (!DBSlotExists("vlans", "switchpath")) {
DBQueryFatal("alter table vlans add `switchpath` ".
" text default NULL after members");
}
# Changed the type of this column
my $type = DBSlotType("lan_attributes", "attrvalue");
if (!$type) {
Fatal("No 'attrvalue' slot in 'lan_attributes' table");
}
if ($type =~ /tinytext/) {
DBQueryFatal("ALTER TABLE lan_attributes MODIFY ".
" `attrvalue` text NOT NULL");
}
return 0;
}
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment