]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1893463: Protect against null emails
authorMike Rylander <mrylander@gmail.com>
Mon, 12 Oct 2020 19:51:29 +0000 (15:51 -0400)
committerJeff Davis <jdavis@sitka.bclibraries.ca>
Wed, 28 Oct 2020 18:31:24 +0000 (11:31 -0700)
commit760130d48834086eb3bb79d8a953497cd236d61d
tree94c0ac1e1a4708449346d4664ec7f090dbc7741e
parentd827650b6fa03aacdd6ac6f6cf2d8c8021f5937b
LP#1893463: Protect against null emails

Unique indexes on nullable columns will allow multiple conceptually
unique rows if the nullable columns are, in fact, NULL because NULL does
not equal itself.  This commit uses COALESCE to make sure that the
nullable email column in the reporter.schedule table gets a value of the
empty string for the purposes of the unique index.  The upgrade script
now also takes this into account and ignores the email column.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/src/sql/Pg/reporter-schema.sql
Open-ILS/src/sql/Pg/upgrade/1241.schema.reporter_schedule_uniqueness.sql