mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Set config_name as a unique index
Work around possible duplicates by keeping the first record.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user