Future-Proof db-cleanup on device deletion #592

Merged
merged 3 commits into from Mar 12, 2015

Projects

None yet

3 participants

@f0o
Member
f0o commented Mar 12, 2015

Solves #588, #587

Does a dynamic lookup on all tables that use device_id or host and deletes entries containing the appropriate device_id.

The fields to lookup for are stored in an array so it can be extended when required for non-standardized tables.

Code was tested against a historically grown setup and removed all traces of the host from the DB.

@f0o f0o changed the title from Issue 588 to Future-Proof db-cleanup on device deletion Mar 12, 2015
@laf laf self-assigned this Mar 12, 2015
@laf laf merged commit 69c87e4 into librenms:master Mar 12, 2015

1 check passed

Scrutinizer 1 new issues
Details
@paulgear
Member

Should we think about adding a more scary warning to the device deletion UI? I can think of scenarios where deleting alerts & event logs immediately might not be the best thing to do, and people should be warned that that's what device deletion does.

@f0o
Member
f0o commented Mar 14, 2015

@paulgear the data becomes useless as the devices's ID is the only glue. This glue is deleted from the devices-table. The remain is a scattered fragmented table where nobody knows what deviceID was what device and the UI will fail displaying it as well (blank fields)

If one needs the logs, he cannot delete the host but only 'ignore' it.

@laf
Member
laf commented Mar 14, 2015

It's worth making people aware of what is going to happen though, I'll create an issue now.

@laf
Member
laf commented Mar 14, 2015

Issue #600 created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment