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

Only update changed columns when updating (at least) entity types

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • None
    • None
    • None

      Every time we update an entity that just uses the Role::InsertUpdateDelete 'update' method, we update every column we pass to it. At the very least attribute edits (such as entity types) pass all form values to this update, whether they have changed or not, so that a change of, say, only description will result on an update call like:

      UPDATE release_group_secondary_type SET parent = ?, child_order = ?, name = ?, description = ? WHERE id = ?

      This is probably the simplest option, but it's causing issues in SIR (e.g. SEARCH-669), because the smart triggers in https://github.com/metabrainz/sir/blob/master/sql/CreateTriggers.sql which do "AFTER UPDATE OF gid, name" get triggered anyway by us updating the unchanged name every time. 

            Unassigned Unassigned
            reosarevok Nicolás Tamargo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Version Package