
ALTER TABLE `accesslog`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD INDEX(`HARDWARE_ID`);

ALTER TABLE `batteries`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD INDEX(`HARDWARE_ID`);

ALTER TABLE `blacklist_macaddresses`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD UNIQUE KEY `MACADDRESS` (`MACADDRESS`);

ALTER TABLE `blacklist_serials`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY(`ID`),
  ADD UNIQUE KEY `SERIAL` (`SERIAL`);

ALTER TABLE `blacklist_subnet`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD UNIQUE KEY `SUBNET` (`SUBNET`,`MASK`);

ALTER TABLE `controllers`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `cpus`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `deleted_equiv`
  ADD KEY `DELETED` (`DELETED`);

ALTER TABLE `drives`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `engine_mutex`
  ADD KEY `PID` (`PID`);

ALTER TABLE `hardware`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`);

ALTER TABLE `inputs`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `itmgmt_comments`
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `journallog`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `memories`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `modems`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `monitors`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `networks`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `ports`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `printers`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `prolog_conntrack`
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`);

ALTER TABLE `registry`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `repository`
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `sim`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `slots`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `snmp_cards`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_cartridges`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_cpus`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_drives`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_fans`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_inputs`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_localprinters`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_memories`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_modems`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_networks`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_ports`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_powersupplies`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_softwares`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_sounds`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_storages`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_switchs`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_trays`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_videos`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `snmp_virtualmachines`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `SNMP_ID` (`SNMP_ID`);

ALTER TABLE `softwares`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `software_category_exp`
  ADD KEY `CATEGORY_ID` (`CATEGORY_ID`);

ALTER TABLE `sounds`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `storages`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `usbdevices`
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `videos`
  DROP PRIMARY KEY,
  DROP INDEX `ID`,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `virtualmachines`
  DROP PRIMARY KEY,
  ADD PRIMARY KEY (`ID`),
  ADD KEY `HARDWARE_ID` (`HARDWARE_ID`);

ALTER TABLE `accountinfo_config` ENGINE = InnoDB;
ALTER TABLE `blacklist_macaddresses` ENGINE = InnoDB;
ALTER TABLE `blacklist_serials` ENGINE = InnoDB;
ALTER TABLE `blacklist_subnet` ENGINE = InnoDB;
ALTER TABLE `config` ENGINE = InnoDB;
ALTER TABLE `deleted_equiv` ENGINE = InnoDB;
ALTER TABLE `deploy` ENGINE = InnoDB;
ALTER TABLE `devicetype` ENGINE = InnoDB;
ALTER TABLE `dico_ignored` ENGINE = InnoDB;
ALTER TABLE `dico_soft` ENGINE = InnoDB;
ALTER TABLE `downloadwk_conf_values` ENGINE = InnoDB;
ALTER TABLE `downloadwk_fields` ENGINE = InnoDB;
ALTER TABLE `downloadwk_history` ENGINE = InnoDB;
ALTER TABLE `downloadwk_pack` ENGINE = InnoDB;
ALTER TABLE `downloadwk_statut_request` ENGINE = InnoDB;
ALTER TABLE `downloadwk_tab_values` ENGINE = InnoDB;
ALTER TABLE `download_affect_rules` ENGINE = InnoDB;
ALTER TABLE `download_servers` ENGINE = InnoDB;
ALTER TABLE `engine_persistent` ENGINE = InnoDB;
ALTER TABLE `files` ENGINE = InnoDB;
ALTER TABLE `groups` ENGINE = InnoDB;
ALTER TABLE `groups_cache` ENGINE = InnoDB;
ALTER TABLE `hardware_osname_cache` ENGINE = InnoDB;
ALTER TABLE `itmgmt_comments` ENGINE = InnoDB;
ALTER TABLE `languages` ENGINE = InnoDB;
ALTER TABLE `network_devices` ENGINE = InnoDB;
ALTER TABLE `operators` ENGINE = InnoDB;
ALTER TABLE `regconfig` ENGINE = InnoDB;
ALTER TABLE `registry_name_cache` ENGINE = InnoDB;
ALTER TABLE `registry_regvalue_cache` ENGINE = InnoDB;
ALTER TABLE `softwares_name_cache` ENGINE = InnoDB;
ALTER TABLE `subnet` ENGINE = InnoDB;
ALTER TABLE `tags` ENGINE = InnoDB;
ALTER TABLE `temp_files` ENGINE = InnoDB;

