This is an old revision of the document!
Table of Contents
New Developers Working Group
Add Fields to Existing Table
This example came from a need that PINES had for annual reports purposes. It adds two new fields to the Organizational Unit table in order to store federal library codes for each location and make those codes available to the reports engine.
1. Update the fieldmapper
File location: Open-ILS\examples\fm_IDL.xml
Add the fields in the "class id="aou"" section:
<field name="fscskey" reporter:label="FSCSKEY" reporter:datatype="text"/>
<field name="fscs_seq" reporter:label="FSCS_SEQ" reporter:datatype="text"/>
The field name must match the column name that you add to the database table. The 'reporter:label' text is what will appear in the list when you are building report templates.
2. Update the schema
File location: Open-ILS\src\sql\Pg\005.schema.actors.sql
Add the fields to the field list in the "CREATE TABLE actor.org_unit" section of SQL:
email TEXT,
phone TEXT,
fscskey TEXT,
fscs_seq TEXT,
\\
opac_visible BOOL