Uploaded image for project: 'SimplyE 2.0'
  1. SimplyE 2.0
  2. SIMPLY-2771

Uniqueness constraints on the configurationsettings table aren't always applied

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Emergency Emergency
    • 3.1.3cm
    • Server - Core
    • None
    • SIMPLY S2 Jan 19 - Feb 2, SIMPLY S3 Feb 2 - 16, SIMPLY S4 Feb 16 - March 2, SIMPLY S5 March 2 - March 16, SIMPLY S6 March 16 - March 30

      The configurationsettings table is instantiated with a uniqueness constraint:

      UniqueConstraint('external_integration_id', 'library_id', 'key'),

      But Postgres won't enforce a uniqueness constraint if any of the columns are null, and it's common for external_integration_id and/or library_id to be null. This means race conditions lead to duplicate rows (which cause persistent problems) rather than one-off errors.

      We recently fixed this problem with the credentials table (https://github.com/NYPL-Simplified/server_core/pull/1129) and we can do the same thing here.

            leonardrichardson Leonard Richardson [X] (Inactive)
            leonardrichardson Leonard Richardson [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: