Icinga / icinga-core

Icinga 1.x, the old core (EOL 31.12.2018)
GNU General Public License v2.0
45 stars 27 forks source link

Fix database upgrade to 1.13.0 with old schema. #1595

Closed sebastic closed 7 years ago

sebastic commented 7 years ago

As reported by Andreas Beckmann in Debian Bug #861077, applying the pgsql-upgrade-1.13.0.sql upgrade script fails when the database was created with an old schema (1.0.2 in this case):

ERROR: constraint "uq_servicedependencies" of relation "icinga_servicedependencies" does not exist

The old pgsql.sql script didn't create the UNIQUE CONSTRAINT with an explicit name as expected by the upgrade script.

Using DROP CONSTRAINT ... IF EXISTS solves this issue, along with conditionally dropping the automatically named constraint from the old schema.

dnsmichi commented 7 years ago

Thanks 👍