Constrain serial.issuance.holding_code to be valid JSON or NULL
This avoids serial.materialize_holding_code() failing on bad data. The
upgrade script will actually throw away bad values for
serial.issuance.holding_code. This is no real loss, since bad data
there prevents any serials functions around the row in question from
working properly anyway.
This problem was reported by Martha Driscoll and Ben Shum.
*Also* put a couple of changes missed from the 0700 upgrade script into
210.schema.serials.sql.
Fix new serial constraint upgrades
1. None of the upgrades so far have moved is_json() from the public
to the evergreen schema. That's probably a separate issue, but it
should be safe to call it unqualified, and that's what the rest of
the upgrade file does, so we will too.
2. Add a specific SET CONSTRAINT to avoid deferred trigger problems
when ALTERing the table.
3. Make sure that the unwanted columns on materialized_holding_code
do not exist regardless of your upgrade path.
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>