Cacti / plugin_weathermap

Weathermap for Cacti 1.x
MIT License
77 stars 26 forks source link

The table `weathermap_settings` does not enforce a unique key on the mapid, groupid, and optname columns #119

Closed TheWitness closed 7 months ago

TheWitness commented 1 year ago

As reported by @leonardo0014 here: https://github.com/Cacti/plugin_weathermap/issues/117#issuecomment-1599169353, the table weathermap_settings allows for the same named object to be inserted a multiple of times which should not happen.

This needs to be resolved through the upgrade script and a modified unique key constraint on the columns.

TheWitness commented 1 year ago

Essentially, we need to:

ALTER TABLE weathermap_settings ADD UNIQUE INDEX mapid_groupid_optname(mapid, groupid, optname);

But the duplicate entries have to be removed first.