Installer needs to clean up database mess, or at least tell the user what to do
Description
Environment
Acceptance / Success Criteria
blocks
Lucidchart Diagrams
Activity
Seth Leger (community account) September 2, 2010 at 3:03 PM
Almost all users should be upgraded far enough that this is no longer an issue. And we've started using liquibase for database migrations in the meantime so that we should have fewer schema upgrade complications in the future. Marking as fixed.
Benjamin Reed October 6, 2008 at 11:52 AM
moving to 1.6.1 target milestone; only things left pending for 1.6.0 are blocker-level bugs
Mike Handler March 22, 2007 at 9:24 AM
From Mike H:
One problem that arises when upgrading OpenNMS is that additional constraints
have been added to the outage table. The constraints ifservices_fkey1 and
ifservices_fkey2 can be violated by entries in the old database. These entries
refer to ifservices records that no longer exist. The following sql statement
cleans up this problem by deleting the outage records that violate the
constraints.
delete from outages where outageid in (SELECT outageid FROM outages LEFT JOIN
ifservices ON (outages.nodeid = ifservices.nodeid AND outages.ipaddr =
ifservices.ipaddr AND outages.serviceid = ifservices.serviceid) WHERE
ifservices.nodeid is NULL AND outages.nodeid IS NOT NULL AND outages.ipaddr IS
NOT NULL AND outages.serviceid IS NOT NULL);
DJ Gregor September 8, 2006 at 5:24 PM
Grrr... need to add a check for ipAddr = 0.0.0.0 in ifServices. Thanks to Tarus for catching and reporting
this.
DJ Gregor September 8, 2006 at 5:23 PM
The last of the changes for this were committed early this morning to trunk.
Details
Assignee
DJ GregorDJ GregorReporter
DJ GregorDJ GregorComponents
Fix versions
Affects versions
Priority
Major
Details
Details
Assignee
Reporter
Components
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty Incident
PagerDuty
PagerDuty Incident
PagerDuty

As we are adding new triggers (and maybe constraints) to support an improved table structure for
Hibernate, the installer needs to clean up any mess in the database, or at least tell the user that there is a
problem and instruct the user on what to do.
Known problem areas:
snmpInterface.{nodeId, ifIndex} uniqueness
ipInterface -> snmpInterface relationships
ifServices -> ipInterface relationships
outages -> ifServices relationships