LP#1893463: Protect against null emails
authorMike Rylander <mrylander@gmail.com>
Mon, 12 Oct 2020 19:51:29 +0000 (15:51 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 22 Oct 2020 19:51:40 +0000 (15:51 -0400)
commit36f7b88e4dbafad0df9b2599e5658f0ecce128f1
tree69e796658c41676e133d23e9e33d138a6762922c
parent23e58c8c2852a55eb2583a7dd132257e80dbeb1a
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