File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -382,9 +382,10 @@ CREATE TABLE `host` (
382382 id int unsigned primary key auto_increment,
383383 ip int unsigned default 0 ,
384384 fqdn varchar (255 ) NOT NULL ,
385- short varchar (50 ) unique ,
385+ short varchar (50 ),
386386 description text ,
387- unique key ` host_details` (fqdn,short,ip)
387+ KEY (` short` ),
388+ UNIQUE KEY ` host_details` (` short` ,` fqdn` ,` ip` )
388389) ENGINE= InnoDB CHARSET= utf8 COLLATE= utf8_unicode_ci;
389390
390391DROP TABLE IF EXISTS ` trail` ;
Original file line number Diff line number Diff line change @@ -15,8 +15,9 @@ ALTER TABLE `syslog` CHANGE `host` `host` INT UNSIGNED NOT NULL ;
1515
1616ALTER TABLE ` host` DROP PRIMARY KEY ;
1717ALTER TABLE ` host` ADD ` id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;
18- ALTER TABLE ` host` ADD UNIQUE ( ` short` );
19- ALTER TABLE ` host` ADD UNIQUE key ` host_details` (` fqdn` ,` short` ,` ip` );
18+ DROP INDEX ` short` ON ` host` ; /* This is meant for the unique index */
19+ CREATE INDEX `short ` on ` host` (` short` );
20+ CREATE UNIQUE INDEX `host_details ` ON ` host` (` fqdn` ,` short` ,` ip` );
2021
2122UPDATE ` syslog` as t1 LEFT JOIN host as t2 ON t1 .host = t2 .ip SET t1 .host = t2 .id ;
2223UPDATE ` archive` as t1 LEFT JOIN host as t2 ON t1 .host = t2 .ip SET t1 .host = t2 .id ;
You can’t perform that action at this time.
0 commit comments