User Tools

Site Tools


newdevs:code:add-fields

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
newdevs:code:add-fields [2021/07/29 18:30] – [1. Update the fieldmapper] tmccannanewdevs:code:add-fields [2024/03/28 22:15] (current) – [3. Edit seed data and create an upgrade script] sandbergja
Line 15: Line 15:
 **''<field name="fscskey" reporter:label="FSCSKEY" reporter:datatype="text"/>''**\\ **''<field name="fscskey" reporter:label="FSCSKEY" reporter:datatype="text"/>''**\\
 **''<field name="fscs_seq" reporter:label="FSCS_SEQ" reporter:datatype="text"/>''**\\ **''<field name="fscs_seq" reporter:label="FSCS_SEQ" reporter:datatype="text"/>''**\\
-</fields>+''</fields>''
  
 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.  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. 
Line 21: Line 21:
 ===== 2. Update the schema ===== ===== 2. Update the schema =====
  
-New installations of Evergreen will use this code when the database tables are created.+New installations of Evergreen will use the code in the Pg folder when the database tables are created. If you are creating a new table for a brand new feature, you'll most likely need to create a new schema file, but in this case we are updating an existing table in the actor schema.
  
 File location: Open-ILS\src\sql\Pg\005.schema.actors.sql File location: Open-ILS\src\sql\Pg\005.schema.actors.sql
Line 34: Line 34:
  
  
-===== 3. Create an upgrade script =====+===== 3. Edit seed data and create an upgrade script =====
  
-Upgrade scripts are required for any changes to the schema or seed data - these are used when a server is being upgraded rather than installed fresh. +Updates to the seed data files as well as upgrade scripts are required for any changes to the schema or seed data. (The seed data files are used for fresh installs and the upgrade scripts are used by existing installations that are upgrading.)
  
 File location: Open-ILS\src\sql\Pg\upgrade\XXXX.federal_codes.sql File location: Open-ILS\src\sql\Pg\upgrade\XXXX.federal_codes.sql
  
 ''BEGIN;''\\ ''BEGIN;''\\
-''ALTER TABLE actor.org unit ADD COLUMN fscskey TEXT, ADD COLUMN fscs_seq TEXT;''\\+''ALTER TABLE actor.org_unit ADD COLUMN fscskey TEXT, ADD COLUMN fscs_seq TEXT;''\\
 ''COMMIT;'' ''COMMIT;''
  
-If you are developing an upgrade script to submit to the Evergreen community, the new upgrade script you create will likely be more complicated. See other examples in the upgrade folder. The "XXXX" in the file name is a placeholder - when the core committers add it to master, they will assign it a number. +If you are developing an upgrade script to submit to the Evergreen community, the new upgrade script you create will likely be more complicated. See other examples in the upgrade folder. The "XXXX" in the file name is a placeholder - when the core committers add it to man, they will assign it a number.  
 + 
 +For more information on upgrade scripts, see [[newdevs:db:upgrade_scripts|Database upgrade scripts]] 
 + 
  
  
  
newdevs/code/add-fields.1627597830.txt.gz · Last modified: 2022/02/10 13:34 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.