Chapter 10. 3.3.0 Upgrade notes

Table of Contents

Migrating Parent/guardian information
Upgrading PostgreSQL

Migrating Parent/guardian information

Sites who traditionally store parent/guardian information in the patron Secondary Identification field can migrate values from this field to the new guardian field with the following SQL:

BEGIN;

-- 1. Find the local ID of the parent/guardian identification type

SELECT * FROM config.identification_type;

-- 2. On my test system, the id is "101".  It will vary!.
-- Migrate the value from the ident2 field to the guardian field.

UPDATE actor.usr
    SET guardian = ident_value2
WHERE
    ident_type2 = 101 -- !! CHANGE TO SUIT
    AND ident_value2 IS NOT NULL
    AND ident_value2 <> '';

-- 3. delete the original secondary identification data

UPDATE actor.usr
    SET ident_value2 = NULL, ident_type2 = NULL
WHERE
    ident_type2 = 101; -- !! CHANGE TO SUIT

COMMIT;