use strict; use libdb; sub DoUpdate($$$) { my ($dbhandle, $dbname, $version) = @_; if (!DBTableExists("widearea_switches")) { DBQueryFatal("CREATE TABLE `widearea_switches` ( ". " `hrn` varchar(255) NOT NULL default '', ". " `node_id` varchar(32) NOT NULL default '', ". " PRIMARY KEY (`hrn`) ". ") ENGINE=MyISAM DEFAULT CHARSET=latin1"); } my $type = DBSlotType("nodes", "role"); if (!$type) { Fatal("No 'role' slot in 'nodes' table"); } if (! ($type =~ /widearea_switch/)) { DBQueryFatal("alter table nodes change `role` `role` ". " enum('testnode','virtnode','ctrlnode','testswitch', ". " 'ctrlswitch','powerctrl','widearea_switch','unused') ". "NOT NULL default 'unused'"); } return 0; } 1;