<?php

/*
 *  LMS version 1.11-git
 *
 *  Copyright (C) 2001-2015 LMS Developers
 *
 *  Please, see the doc/AUTHORS for more information about authors!
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License Version 2 as
 *  published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 *  USA.
 *
 *  $Id$
 */

$this->BeginTrans();

$this->Execute("
	CREATE SEQUENCE netdeviceproducers_id_seq;
	CREATE TABLE netdeviceproducers (
		id integer DEFAULT nextval('netdeviceproducers_id_seq'::text) NOT NULL,
		name varchar(255) NOT NULL,
		alternative_name varchar(255),
		PRIMARY KEY (id),
		UNIQUE (name)
	)
");

$this->Execute("
	CREATE SEQUENCE netdevicemodels_id_seq;
	CREATE TABLE netdevicemodels (
		id integer DEFAULT nextval('netdevicemodels_id_seq'::text) NOT NULL,
		netdeviceproducerid INT NOT NULL,
		name varchar(255) NOT NULL,
		alternative_name varchar(255),
		PRIMARY KEY (id),
		FOREIGN KEY (netdeviceproducerid) REFERENCES netdeviceproducers(id) ON DELETE CASCADE ON UPDATE CASCADE,
		UNIQUE (name, netdeviceproducerid)
	)
");

$this->Execute("INSERT INTO netdeviceproducers (name) VALUES ('Mikrotik')");
$prodid = $this->GetLastInsertID('netdeviceproducers');

$this->Execute("
INSERT INTO netdevicemodels (name, alternative_name, netdeviceproducerid) VALUES
('RB750', NULL, $prodid),
('RB750UP', NULL, $prodid),
('RB750GL', NULL, $prodid),
('PowerBox', NULL, $prodid),
('RB2011iL-IN', NULL, $prodid),
('RB2011iL-RM', NULL, $prodid),
('RB2011iLS-IN', NULL, $prodid),
('RB2011UiAS-IN', NULL, $prodid),
('RB2011UiAS-RM', NULL, $prodid),
('RB1100AHx2', NULL, $prodid),
('CCR1009-8G-1S', NULL, $prodid),
('CCR1009-8G-1S-1S+', NULL, $prodid),
('CCR1009-8G-1S-1S+PC', NULL, $prodid),
('CCR1016-12S-1S+', NULL, $prodid),
('CCR1016-12G', NULL, $prodid),
('CCR1036-12G-4S', NULL, $prodid),
('CCR1036-8G-2S+', NULL, $prodid),
('CCR1036-12G-4S-EM', NULL, $prodid),
('CCR1036-8G-2S+EM', NULL, $prodid),
('RB1100AHx2-LM', NULL, $prodid),
('RB750G', NULL, $prodid),
('RB1000', NULL, $prodid),
('RB1000U', NULL, $prodid),
('RB1100', NULL, $prodid),
('RB1100Hx2', NULL, $prodid),
('RB1100AH', NULL, $prodid),
('RB1200', NULL, $prodid),
('RB260GS', NULL, $prodid),
('RB260GSP', NULL, $prodid),
('CRS109-8G-1S-2HnD-IN', NULL, $prodid),
('CRS210-8G-2S+IN', NULL, $prodid),
('CRS212-1G-10S-1S+IN', NULL, $prodid),
('CRS125-24G-1S-IN', NULL, $prodid),
('CRS125-24G-1S-RM', NULL, $prodid),
('CRS125-24G-1S-2HnD-IN', NULL, $prodid),
('CRS226-24G-2S+IN', NULL, $prodid),
('CRS226-24G-2S+RM', NULL, $prodid),
('RB250GS', NULL, $prodid),
('NetMetal 5', NULL, $prodid),
('SXT 5 ac', NULL, $prodid),
('SXT SA5 ac', NULL, $prodid),
('NetBox 5', NULL, $prodid),
('SXT Lite2', NULL, $prodid),
('SXT Lite5', NULL, $prodid),
('Groove 52HPn', NULL, $prodid),
('GrooveA 52HPn', NULL, $prodid),
('SXT 2', NULL, $prodid),
('SXT 5', NULL, $prodid),
('BaseBox 2', NULL, $prodid),
('BaseBox 5', NULL, $prodid),
('OmniTIK U-5HnD', NULL, $prodid),
('SXT HG5', NULL, $prodid),
('SXT SA5', NULL, $prodid),
('OmniTIK UPA-5HnD', NULL, $prodid),
('Metal 9HPn', NULL, $prodid),
('Metal 2SHPn', NULL, $prodid),
('Metal 5SHPn', NULL, $prodid),
('SEXTANT G 5HPnD', NULL, $prodid),
('QRT 2', NULL, $prodid),
('QRT 5', NULL, $prodid),
('SXT Sixpack', NULL, $prodid),
('SXT 5HnD', NULL, $prodid),
('SXT G-5HnD', NULL, $prodid),
('RB951-2n', NULL, $prodid),
('mAP 2n', NULL, $prodid),
('cAP 2n', NULL, $prodid),
('RB951Ui-2HnD', NULL, $prodid),
('RB951G-2HnD', NULL, $prodid),
('RB2011UiAS-2HnD-IN', NULL, $prodid),
('RB751U-2HnD', NULL, $prodid),
('RB751G-2HnD', NULL, $prodid),
('911 Lite2', NULL, $prodid),
('911 Lite5', NULL, $prodid),
('RB411L', NULL, $prodid),
('911 Lite5 dual', NULL, $prodid),
('RB411', NULL, $prodid),
('RB911G-2HPnD', NULL, $prodid),
('RB450', NULL, $prodid),
('RB411GL', NULL, $prodid),
('RB911G-5HPnD', NULL, $prodid),
('RB411U', NULL, $prodid),
('RB911G-5HPacD', NULL, $prodid),
('RB912UAG-2HPnD', NULL, $prodid),
('RB912UAG-5HPnD', NULL, $prodid),
('RB411AR', NULL, $prodid),
('RB433UL', NULL, $prodid),
('RB433', NULL, $prodid),
('RB450G', NULL, $prodid),
('RB411AH', NULL, $prodid),
('RB922UAGS-5HPacD', NULL, $prodid),
('RB850Gx2', NULL, $prodid),
('RB433GL', NULL, $prodid),
('RB433AH', NULL, $prodid),
('RB953GS-5HnT-RP', NULL, $prodid),
('RB493AH', NULL, $prodid),
('RB435G', NULL, $prodid),
('RB493G', NULL, $prodid),
('RB800', NULL, $prodid),
('RB433UAH', NULL, $prodid),
('RB411UAHL', NULL, $prodid),
('RB493', NULL, $prodid),
('RB711-5Hn', NULL, $prodid),
('RB711-2Hn', NULL, $prodid),
('RB2011L', NULL, $prodid),
('RB2011LS', NULL, $prodid),
('RB433L', NULL, $prodid),
('RB2011UiAS-2HnD', NULL, $prodid),
('RB711-5Hn-U', NULL, $prodid),
('RB411UAHR', NULL, $prodid),
('RB433UAHL', NULL, $prodid),
('RB711GA-5HnD', NULL, $prodid),
('RB711A-5Hn-M', NULL, $prodid),
('CCR1016-12G-BU', NULL, $prodid),
('RB411R', NULL, $prodid),
('RB711-5Hn-M', NULL, $prodid),
('RB600A', NULL, $prodid),
('Crossroads', NULL, $prodid),
('RB411A', NULL, $prodid),
('CA411-711', NULL, $prodid),
('CA150', NULL, $prodid),
('CA433U', NULL, $prodid),
('CA493', NULL, $prodid),
('CA800', NULL, $prodid),
('CAOTS', NULL, $prodid),
('CAOTU', NULL, $prodid),
('S-RJ01', NULL, $prodid),
('S-85DLC05D', NULL, $prodid),
('S-31DLC20D', NULL, $prodid),
('S-3553LC20D', NULL, $prodid),
('S+85DLC03D', NULL, $prodid),
('S+31DLC10D', NULL, $prodid),
('S+2332LC10D', NULL, $prodid),
('SFP+ 1m direct attach cable', NULL, $prodid),
('SFP+ 3m direct attach cable', NULL, $prodid),
('R11e-2HnD', NULL, $prodid),
('R11e-2HPnD', NULL, $prodid),
('R11e-5HnD', NULL, $prodid),
('R11e-5HacD', NULL, $prodid),
('R2SHPn', NULL, $prodid),
('R5SHPn', NULL, $prodid),
('R52nM', NULL, $prodid),
('R52H', NULL, $prodid),
('R52Hn', NULL, $prodid),
('RB14e', NULL, $prodid),
('RB14eU', NULL, $prodid),
('RB44Ge', NULL, $prodid),
('RB502', NULL, $prodid),
('RB604', NULL, $prodid),
('IAMP1E', NULL, $prodid),
('R5H', NULL, $prodid),
('R5nH', NULL, $prodid),
('R2N', NULL, $prodid),
('R52N', NULL, $prodid),
('RB44GV', NULL, $prodid),
('R52', NULL, $prodid),
('IAMP1', NULL, $prodid),
('FTC', NULL, $prodid),
('Flex-guide', NULL, $prodid),
('MMCX-RPSMA pigtail', NULL, $prodid),
('2.4Ghz Dipole', NULL, $prodid),
('RB2011 mount', NULL, $prodid),
('48 to 24V PoE Converter', NULL, $prodid),
('18POW', NULL, $prodid),
('24HPOW', NULL, $prodid),
('48POW', NULL, $prodid),
('5VUSB', NULL, $prodid),
('RBPOE', NULL, $prodid),
('RBGPOE', NULL, $prodid),
('ACUFL', NULL, $prodid),
('ACMMCX', NULL, $prodid),
('ACSWI', NULL, $prodid),
('ACSWIM', NULL, $prodid),
('Radome Cover Kit', NULL, $prodid),
('mANT30 PA', NULL, $prodid),
('mANT30', NULL, $prodid)
");

$this->Execute("INSERT INTO netdeviceproducers (name) VALUES ('Ubiquiti')");
$prodid = $this->GetLastInsertID('netdeviceproducers');

$this->Execute("
INSERT INTO netdevicemodels (name, alternative_name, netdeviceproducerid) VALUES
('3391-A', 'SR71A', $prodid),
('AF-24', 'AIRFIBER 1.4GBPS+ BACKHAUL 24GHZ (SHIPPED AS SINGLES)', $prodid),
('AF-5', 'AIRFIBER 1GBPS+ BACKHAUL 5.4-5.8GHZ', $prodid),
('AG-HP-2G16', '2.4GHZ AIRGRID AIRMAX 16DBI', $prodid),
('AG-HP-2G20', '5PK 2.4GHZ AIRGRID AIRMAX 20DBI', $prodid),
('AG-HP-5G23', '5PK 5GHZ AIRGRID AIRMAX 23DBI', $prodid),
('AG-HP-5G27', '5PK 5GHZ AIRGRID AIRMAX 27DBI', $prodid),
('AIRCAM', 'AIRCAM', $prodid),
('AIRCAM-3', 'AIRCAM 3-PACK', $prodid),
('AIRCAM-DOME', 'AIRCAM DOME', $prodid),
('AIRCAM-DOME-3', 'AIRCAM-DOME 3PK SOLUTION 3 PACK', $prodid),
('AIRCAM-MINI', 'AIRCAM-MINI VIDEO SOLUTION', $prodid),
('AIRGATEWAY', 'AIRGATEWAY INDOOR AP', $prodid),
('AIRGATEWAY-LR', 'AIRGATEWAY INDOOR AP LONG RANGE ANTENNA', $prodid),
('AIRROUTER', 'AIRROUTER INDOOR AP', $prodid),
('AIRROUTER-HP', 'AIRROUTER INDOOR AP HP EXT ANT', $prodid),
('AIRVISION-C', 'AIRVISION NVR CONTROLLER', $prodid),
('AM-2G15-120', '2.3-2.7GHZ AIRMAX BASE STATION 15DBI 120 DEG W/ ROCKET KIT', $prodid),
('AM-2G16-90', '2.3-2.7GHZ AIRMAX BASE STATION 16DBI 90DEG W/ ROCKET KIT', $prodid),
('AM-3G18-120', '3.3-3.8GHZ AIRMAX BASE STATION 18DBI 120 DEG W/ROCKET KIT', $prodid),
('AM-5AC21-60', '5G AIRMAX AC 60 DEGREES SECTOR ANTENNA 21DBI', $prodid),
('AM-5AC22-45', '5G AIRMAX AC 45 DEGREES SECTOR ANTENNA 22DBI', $prodid),
('AM-5G16-120', '4.9-5.9GHZ AIRMAX BASE STATION 16DBI 120 DEG W/ ROCKET KIT', $prodid),
('AM-5G17-90', '4.9-5.9GHZ AIRMAX BASE STATION 17DBI 90 DEG W/ROCKET KIT', $prodid),
('AM-5G19-120', '4.9-5.9GHZ AIRMAX BASE STATION 19DBI 120 DEG W/ ROCKET KIT', $prodid),
('AM-5G20-90', '4.9-5.9GHZ AIRMAX BASE STATION 20DBI 90 DEG W/ ROCKET KIT', $prodid),
('AM-9M13-120', '900MHZ AIRMAX BASE STATION 13DBI', $prodid),
('AM-M-V5G-TI', '5GHZ VARIABLE BEAM BASE STATION MID-GAIN 60-120DEG TI W/ ROCKET KIT', $prodid),
('AMO-2G10', '2GHZ AIRMAX DUAL OMNI 10DBI W/ ROCKET KIT', $prodid),
('AMO-2G13', '2GHZ AIRMAX DUAL OMNI 13DBI W/ ROCKET KIT', $prodid),
('AMO-3G12', '3GHZ AIRMAX DUAL OMNI 12DBI W/ ROCKET KIT', $prodid),
('AMO-5G10', '5GHZ AIRMAX DUAL OMNI 10DBI W/ ROCKET KIT', $prodid),
('AMO-5G13', '5GHZ AIRMAX DUAL OMNI 13DBI W/ ROCKET KIT', $prodid),
('AM-V2G-TI', '2GHZ VARIABLE BEAM BASE STATION 60-120DEG TITANIUM W/ROCKET KIT', $prodid),
('AM-V5G-TI', '5GHZ VARIABLE BEAM BASE STATION 60-120DEG TITANIUM W/ROCKET KIT', $prodid),
('AMY-9M16-2', '900MHZ AIRMAX YAGI ANTENNA 16DBI W/ ROCKET KIT 2-PACK', $prodid),
('BM2-TI', '2.4GHZ BULLET AIRMAX TITANIUM POE/ADAPTER INCL', $prodid),
('BULLET5', 'BULLET5 CPE', $prodid),
('BULLETM2-HP', '2.4GHZ BULLET AIRMAX HP', $prodid),
('BULLETM5-HP', '5GHZ BULLET AIRMAX HP', $prodid),
('BULLETM5-TI', '5GHZ BULLET AIRMAX TITANIUM POE/ADAPTER INCL', $prodid),
('ER-8', 'EDGEROUTER 8 5PORT ROUTER', $prodid),
('ERLITE-3', 'EDGEROUTER LITE 3PORT', $prodid),
('ERPOE-5', 'EDGEROUTER POE 5PORT ROUTER WITH POE', $prodid),
('ERPRO-8', 'EDGEROUTER PRO 8 8PORT ROUTER 2 SFP', $prodid),
('ES-24-250W', 'EDGE SWITCH 24 250W', $prodid),
('ES-24-500W', 'EDGE SWITCH 24PORT 500W', $prodid),
('ES-48-500W', 'EDGE SWITCH 48PORT 500W', $prodid),
('ES-48-750W', 'EDGE SWITCH 48PORT 750W', $prodid),
('ETH-SP', 'ETHERNET SURGE PROTECTOR', $prodid),
('INS-8023AF-I', 'INSTANT 8023AF ADAPTER INDOOR', $prodid),
('INS-8023AF-O', 'INSTANT 8023AF ADAPTER OUTDOOR', $prodid),
('LOCOM2', '2.4GHZ LOCO MIMO AIRMAX', $prodid),
('LOCOM5', '5GHZ LOCO MIMO AIRMAX', $prodid),
('LOCOM900', '900MHZ LOCO MIMO AIRMAX', $prodid),
('MFI-CS', 'MFI CURRENT SENSOR', $prodid),
('MFI-DS', 'MFI DOOR SENSOR', $prodid),
('MFI-LD', 'IN-WALL MANAGEABLE SWITCH/ DIMMER', $prodid),
('MFI-MPW', 'IN-WALL MANAGEABLE OUTLET', $prodid),
('MFI-MSC', 'MFI CEILING MOUNT MOTION SENSOR', $prodid),
('MFI-MSW', 'MFI WALL MOUNT MOTION SENSOR', $prodid),
('MFI-THS', 'MFI TEMPERATURE SENSOR', $prodid),
('MPORT', 'MFI MPORT', $prodid),
('MPORT-S', 'MFI MPORT SERIAL', $prodid),
('MPOWER', 'MFI 3PORT POWER EU & US WIFI', $prodid),
('MPOWER-MINI', 'MFI 1PORT POWER EU & US WIFI', $prodid),
('MPOWER-PRO', 'MFI 8PORT US 6PORT EU POWER WIFI/ETH', $prodid),
('NANOMOUNT', 'NANOMOUNT', $prodid),
('NBE-M5-19', '5GHZ NANOBEAM AIRMAX 19DB', $prodid),
('NBE-M5-400', '5PK 5GHZ NANOBEAM AIRMAX 400MM', $prodid),
('NBE-RAD-400', 'NANOBEAM RADOME 400MM', $prodid),
('NBE-WMK', 'NANOBEAM WALL MOUNT KIT', $prodid),
('NBM3', '3.5GHZ NANOBRIDGE AIRMAX 22DBI 2 PARTS NBM3+NB-OD3', $prodid),
('NBM365', '3.65GHZ NANOBRIDGE AIRMAX 22DBI 2 PARTS NBM365+NB-OD3', $prodid),
('NBM9', '900MHZ NANOBRIDGE AIRMAX 13DBI 2 PARTS NBM9+NB-OD9', $prodid),
('NSM2', '2.4GHZ NANO MIMO AIRMAX', $prodid),
('NSM3', '3.5GHZ NANO MIMO AIRMAX', $prodid),
('NSM365', '3.65GHZ NANOBRIDGE AIRMAX 22DBI 2 PARTS NBM365+NB-OD3', $prodid),
('NSM5', '5GHZ NANO MIMO AIRMAX', $prodid),
('PBM10', '10GHZ POWERBRIDGE MIMO AIRMAX 2 PARTS - PBM10 $275 + PBM10-DISH 75', $prodid),
('PBM3', '3.5GHZ POWERBRIDGE MIMO AIRMAX', $prodid),
('PBM365', '3.65GHZ POWERBRIDGE MIMO AIRMAX', $prodid),
('PBM5', '5GHZ POWERBRIDGE MIMO AIRMAX', $prodid),
('PICOM2-HP', '2.4GHZ PICO AIRMAX HP', $prodid),
('POE-24-12W', 'POE INJECTOR 24VDC 12W', $prodid),
('POE-24-24W', 'POE INJECTOR 24VDC 24W', $prodid),
('POE-48-24W', 'POE INJECTOR 48VDC 24W', $prodid),
('POE-48-24W-G', 'POE INJECTOR 48VDC 24W ROCKETTI UAP-PRO', $prodid),
('POE-50-60W', 'POE INJECTOR 50V 60W AIRFIBER POE', $prodid),
('PS2-17D', 'POWERSTATION2-17D CPE', $prodid),
('PS5-22V', 'POWERSTATION5-22V CPE', $prodid),
('RAD-2RD', 'RADOME 2 ROCKETDISH EAR99 RADOME FOR ROCKETDISH', $prodid),
('RAD-3RD', 'RADOME 3 ROCKETDISH EAR99 RADOME FOR ROCKETDISH', $prodid),
('RD-2G24', '2GHZ ROCKET DISH 24DBI W/ ROCKET KIT', $prodid),
('RD-3G26', '3GHZ ROCKET DISH 26DBI W/ ROCKET KIT', $prodid),
('RD-5G30', '5GHZ ROCKET DISH 30DBI W/ ROCKET KIT', $prodid),
('RD-5G34', '5GHZ ROCKET DISH 34DBI W/ROCKET KIT', $prodid),
('RM2-TI', '2.4GHZ ROCKET MIMO AIRMAX TITANIUM', $prodid),
('RM5-TI', '5GHZ ROCKET MIMO AIRMAX TITANIUM', $prodid),
('ROCKETM2', '2.4GHZ ROCKET MIMO AIRMAX', $prodid),
('ROCKETM3', '3.5GHZ ROCKET MIMO AIRMAX', $prodid),
('ROCKETM365', '3.65GHZ ROCKET MIMO AIRMAX', $prodid),
('ROCKETM5', '5GHZ ROCKET MIMO AIRMAX', $prodid),
('ROCKETM9', '900MHZ ROCKET MIMO AIRMAX', $prodid),
('SR2', 'SR2 MINI PCI PCBA', $prodid),
('SR5', 'SR5 MINI PCI PCBA', $prodid),
('SR71-15', '11A/N 5GHZ 27DBM 2X2 OUTDOOR', $prodid),
('SR71E', '11A/B/G/N 200MW 2X2 EXT. ANTENNA', $prodid),
('SRC', 'SRC CARDBUS', $prodid),
('TC-CARRIER', 'TOUGH CABLE LEVEL 2 1000 BOX', $prodid),
('TC-CON', 'TOUGH CABLE CONNEXTRS X 2400 100PCS/BOX', $prodid),
('TC-GND', 'TOUGH CABLE CONNECTOR GROUND X 1000', $prodid),
('TC-PRO', 'TOUGH CABLE LEVEL 1 1000 BOX', $prodid),
('TS-16-CARRIER', 'TOUGHSWITCH 16PORT POE PRO RACKMOUNT', $prodid),
('TS-5-POE', 'TOUGHSWITCH 5PORT POE', $prodid),
('TS-8-PRO', 'TOUGHSWITCH 8PORT POE PRO', $prodid),
('UAP', 'UNIFI AP', $prodid),
('UAP-3', 'UNIFI AP 3-PACK', $prodid),
('UAP-AC', 'UNIFI AP 802.11AC', $prodid),
('UAP-AC-3', 'UNIFI AP AC 3PK', $prodid),
('UAP-AC-OUTDOOR', 'UNIFI AP AC OUTDOOR', $prodid),
('UAP-LR', 'UNIFI AP LONG RANGE', $prodid),
('UAP-LR-3', 'UNIFI AP LONG RANGE 3-PACK', $prodid),
('UAP-OUTDOOR+', 'UNIFI AP OUTDOOR+ XRF', $prodid),
('UAP-OUTDOOR-5', 'UNIFI AP OUTDOOR 5GHZ', $prodid),
('UAP-PRO', 'UNIFI AP PRO GIGE 802.3AF DUAL RADIO', $prodid),
('UAP-PRO-3', 'UNIFI AP PRO GIGE 802.3AF DUAL RADIO 3PK', $prodid),
('UB-AM', '10PK UBIQUITI ANTENNA MOUNT', $prodid),
('USG', 'UNIFI SECURITY GATEWAY', $prodid),
('UVC', 'UNIFI VIDEO CAMERA IR', $prodid),
('UVC-3', 'UNIFI VIDEO CAMERA IR 3PK', $prodid),
('UVC-DOME', 'UNIFI VIDEO CAMERA DOME IR', $prodid),
('UVC-DOME-3', 'UNIFI VIDEO CAMERA DOME IR 3-PACK', $prodid),
('UVC-NVR', 'AIRVISION NVR CONTROLLER', $prodid),
('UVC-PRO', 'UNIFI VIDEO CAMERA PRO', $prodid),
('UVC-PRO-C', 'UNIFI CAMERA PRO CABLE ACCESSORY', $prodid),
('UVC-PRO-M', 'UNIFI CAMERA PRO MOUNT ACCESSORY', $prodid),
('UVP', 'UNIFI VOIP PHONE', $prodid),
('WS5', 'WS5 SUBSCRIBER', $prodid),
('WSM5', 'WISPSTATION M SERIES 5GHZ AIRMAX', $prodid),
('XR2', 'MINI PCI 600MW 2.4GHZ', $prodid),
('XR5', 'MINI PCI 600MW 5GHZ', $prodid),
('XR7', 'XR7 MINI PCI PCBA', $prodid),
('XR9', 'MINI PCI 600MW 900MHZ', $prodid)
");

$this->Execute("ALTER TABLE netdevices ADD COLUMN netdevicemodelid integer DEFAULT NULL");
$this->Execute("ALTER TABLE netdevices ADD CONSTRAINT netdevices_netdevicemodel_fkey FOREIGN KEY (netdevicemodelid) REFERENCES netdevicemodels (id) ON UPDATE CASCADE ON DELETE SET NULL");

$this->Execute("UPDATE dbinfo SET keyvalue = ? WHERE keytype = ?", array('2015020900', 'dbversion'));

$this->CommitTrans();
