newdevs:code:add-fields
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
newdevs:code:add-fields [2021/07/29 18:19] – [Add Fields to Existing Table] tmccanna | newdevs:code:add-fields [2024/03/28 22:15] (current) – [3. Edit seed data and create an upgrade script] sandbergja | ||
---|---|---|---|
Line 12: | Line 12: | ||
Add the fields in the "class id=" | Add the fields in the "class id=" | ||
- | ''< | + | ''< |
- | '' | + | **'' |
+ | **''< | ||
+ | '' | ||
The field name must match the column name that you add to the database table. The ' | The field name must match the column name that you add to the database table. The ' | ||
===== 2. Update the schema ===== | ===== 2. Update the schema ===== | ||
+ | |||
+ | 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 30: | Line 34: | ||
+ | ===== 3. Edit seed data and create an upgrade script ===== | ||
+ | |||
+ | 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 | ||
+ | |||
+ | '' | ||
+ | '' | ||
+ | '' | ||
+ | |||
+ | 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 " | ||
+ | For more information on upgrade scripts, see [[newdevs: | ||
newdevs/code/add-fields.txt · Last modified: 2024/03/28 22:15 by sandbergja