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

Report on relations with dates in the future

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2020-06-29
    • None
    • Reports
    • None

      It could be useful to have a report about relationships with dates in the future, most commonly coming from typos.

       

      I fixed a few after running on my local database dump:

      WITH l AS (
      SELECT l.id, l.begin_date_year AS begin, l.end_date_year AS end, lt.entity_type0, lt.entity_type1
      FROM link AS l
      JOIN link_type AS lt ON lt.id=l.link_type
      WHERE l.begin_date_year > 2020
      OR l.end_date_year > 2030
      )
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/recording/' || e.gid
      FROM l
      JOIN l_recording_work AS lar ON lar.link=l.id
      JOIN recording AS e ON e.id=lar.entity0
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/recording/' || e.gid
      FROM l
      JOIN l_area_recording AS lar ON lar.link=l.id
      JOIN recording AS e ON e.id=lar.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/release/' || e.gid
      FROM l
      JOIN l_area_release AS lar ON lar.link=l.id
      JOIN release AS e ON e.id=lar.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/recording/' || e.gid
      FROM l
      JOIN l_artist_recording AS lar ON lar.link=l.id
      JOIN recording AS e ON e.id=lar.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/label/' || e.gid
      FROM l
      JOIN l_artist_label AS lal ON lal.link=l.id
      JOIN label AS e ON e.id=lal.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/release-group/' || e.gid
      FROM l
      JOIN l_artist_release_group AS larr ON larr.link=l.id
      JOIN release_group AS e ON e.id=larr.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/artist/' || e.gid
      FROM l
      JOIN l_artist_artist AS laa ON laa.link=l.id
      JOIN artist AS e ON e.id=laa.entity0
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/recording/' || e.gid
      FROM l
      JOIN l_label_recording AS llr ON llr.link=l.id
      JOIN recording AS e ON e.id=llr.entity1
      UNION
      SELECT l.begin, l.end, l.entity_type0, l.entity_type1, 'http://musicbrainz.org/recording/' || e.gid
      FROM l
      JOIN l_place_recording AS lpr ON lpr.link=l.id
      JOIN recording AS e ON e.id=lpr.entity1
      ;

       

      Some links might be valid though (e.g. a conductor-orchestra relation about an ongoing 10 years contract)

            loujin loujin
            loujin loujin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2020-06-29