-- update to 0.20
INSERT INTO updates SET update_version = '0.20', name = 'Device Properties Table', version_applied_to = '0.19', dateapplied = now();
CREATE TABLE `dev_props` (`id` INT NOT NULL AUTO_INCREMENT, `dev_type_id` INT NOT NULL, `name` VARCHAR( 200 ) NOT NULL, `test_type` TINYINT NOT NULL, `test_id` INT NOT NULL, `test_params` VARCHAR( 150 ) NOT NULL, PRIMARY KEY ( `id` )) TYPE = MYISAM;

INSERT INTO updates SET update_version = '0.20', name = 'Device Properties Values Table', version_applied_to = '0.19', dateapplied = now();
CREATE TABLE `dev_prop_vals` ( `dev_id` INT NOT NULL, `prop_id` INT NOT NULL, `value` VARCHAR( 250 ) NOT NULL, PRIMARY KEY ( `dev_id` , `prop_id` ));

INSERT INTO updates SET update_version = '0.20', name = 'SNMP Interface Cache New Fields', version_applied_to = '0.19', dateapplied = now();
ALTER TABLE `snmp_interface_cache` ADD `nexthop` VARCHAR( 20 ) , ADD `vlan` VARCHAR( 20 ) , ADD `mode` TINYINT;

INSERT INTO updates SET update_version = '0.20', name = 'Graph Item Consolidation Function Field', version_applied_to = '0.19', dateapplied = now();
ALTER TABLE `graph_ds` ADD `cf` TINYINT NOT NULL DEFAULT '1';

INSERT INTO updates SET update_version = '0.20', name = 'Device Unknowns on SNMP Restart Field', version_applied_to = '0.19', dateapplied = now();
ALTER TABLE `devices` ADD `unknowns_on_snmp_restart` TINYINT NOT NULL DEFAULT '1';

UPDATE `versioninfo` set version = '0.20' where module = 'Main';
