librenms/sql-schema/109.sql
Tony Murray 5c81602966 Set config_name as a unique index
Work around possible duplicates by keeping the first record.
2016-03-18 23:20:02 -05:00

6 lines
224 B
SQL

CREATE TABLE tmp_table LIKE config;
ALTER IGNORE TABLE tmp_table ADD UNIQUE INDEX uniqueindex_configname (config_name);
INSERT IGNORE INTO tmp_table SELECT * FROM config;
DROP TABLE config;
RENAME TABLE tmp_table TO config;