-- NOTE Column collations were changed from UTF-8 to Latin1 where it wasn’t actually necessary
ALTER TABLE `discovery_perf_history` CHANGE `module` `module` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `dashboards` CHANGE `category` `category` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `slug` `slug` VARCHAR(128) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `device_graphs` CHANGE `graph` `graph` VARCHAR(128) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `api_tokens` CHANGE `token_hash` `token_hash` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'SHA256 hash of the actual token', CHANGE `token_prefix` `token_prefix` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'First 12 chars for identification (obs_XXXXXXXX)';
ALTER TABLE `stp_ports` CHANGE `state` `state` ENUM('disabled','blocking','listening','learning','forwarding','discarding','broken','unknown') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'unknown', CHANGE `role` `role` ENUM('unknown','disabled','alternate','backup','root','designated','master','boundary') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'unknown', CHANGE `point2point` `point2point` ENUM('unknown','true','false') CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT 'unknown', CHANGE `guard` `guard` SET('bpdu','root','loop','bridge-assurance','bpdu-filter') CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `stp_ports` CHANGE `designated_bridge` `designated_bridge` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `designated_root` `designated_root` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `stp_instances` CHANGE `type` `type` ENUM('cist','msti','pvst') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, CHANGE `designated_root` `designated_root` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `regional_root` `regional_root` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `stp_bridge` CHANGE `variant` `variant` ENUM('stp','rstp','mstp','pvst','rpvst','unknown') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'unknown', CHANGE `designated_root` `designated_root` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `bridge_id` `bridge_id` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `ports` CHANGE `ifIndex` `ifIndex` VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifConnectorPresent` `ifConnectorPresent` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifPromiscuousMode` `ifPromiscuousMode` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifOperStatus` `ifOperStatus` ENUM('testing','notPresent','dormant','down','lowerLayerDown','unknown','up','monitoring') CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifAdminStatus` `ifAdminStatus` ENUM('down','up','testing') CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifDuplex` `ifDuplex` VARCHAR(12) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifType` `ifType` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifPhysAddress` `ifPhysAddress` VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifVlan` `ifVlan` VARCHAR(16) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL, CHANGE `ifTrunk` `ifTrunk` VARCHAR(8) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
ALTER TABLE `vlans_fdb` CHANGE `fdb_port` `fdb_port` VARCHAR(32) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL COMMENT 'Same as ifIndex type';
ALTER TABLE `probes` CHANGE `probe_type` `probe_type` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, CHANGE `probe_status` `probe_status` ENUM('ok','warning','alert','unknown') CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT 'unknown';
ALTER TABLE `alert_tests` CHANGE `entity_type` `entity_type` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL, CHANGE `alerter` `alerter` VARCHAR(64) CHARACTER SET latin1 COLLATE latin1_general_ci NULL DEFAULT NULL;
