Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-1133

Don't try to delete relationship types that are still in use

XMLWordPrintable

      If a relationship editor tries to delete a relationship type that's already in use, it doesn't check whether it can be deleted first, so I got an error like:

      Caught exception in MusicBrainz::Server::Controller::Admin::LinkType->delete "Failed query:
      'DELETE FROM link_type WHERE id = ?'
      (279)
      DBD::Pg::st execute failed: ERROR: update or delete on table "link_type" violates foreign key constraint "link_fk_link_type" on table "link"
      DETAIL: Key (id)=(279) is still referenced from table "link". at /home/mbserver/musicbrainz/mb_server-next/script/../lib/Sql.pm line 102.

      at /home/mbserver/musicbrainz/mb_server-next/script/../lib/MusicBrainz/Server/Data/LinkType.pm line 196
      at /home/mbserver/musicbrainz/mb_server-next/script/../lib/MusicBrainz/Server/Controller/Admin/LinkType.pm line 144"

      Probably not very high priority since only a handful of people can even edit relationship types, but we have a nice "still in use" page for relationship attributes, so I don't see why we shouldn't have one for the relationships themselves as well.

            acid2 Oliver Charles
            nikki nikki
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                Bug fixes, 2011-09-19