Difference between revisions of "Freeside:Documentation:Developer:Schema changes"
From Freeside
(→Essential documentation) |
(→Skeleton class autogeneration) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
* Required | * Required | ||
* Edit the big data structure in FS/FS/Schema.pm and add your tables and columns | * Edit the big data structure in FS/FS/Schema.pm and add your tables and columns | ||
− | + | * The upgrade script will automatically handle new tables as well as new columns, removed columns and changes to columns and indices. | |
− | |||
− | |||
− | * The upgrade script will automatically handle new tables as well as new columns, removed columns and changes to indices. | ||
− | |||
=== Skeleton class autogeneration === | === Skeleton class autogeneration === | ||
Line 13: | Line 9: | ||
* For new tables. Optional but recommended. We're trying to save you work! | * For new tables. Optional but recommended. We're trying to save you work! | ||
* Make sure the tables have been added to FS/FS/Schema.pm and run <code>make install-perl-modules</code> | * Make sure the tables have been added to FS/FS/Schema.pm and run <code>make install-perl-modules</code> | ||
− | * From the root freeside directory, run <code>bin/generate-table-module <i>tablename</i></code> for each table. | + | * From the root freeside directory, run <code>bin/generate-table-module <i>tablename</i></code> for each table. Use the <code>-n</code> option if you prefer not to have Mason load the table module. |
* Edit the resulting FS/FS/table.pm | * Edit the resulting FS/FS/table.pm | ||
− | * FS/MANIFEST is updated and FS/t/table.t is added. Don't forget to | + | * FS/MANIFEST is updated and FS/t/table.t is added. Don't forget to git add FS/FS/table.pm and FS/t/table.t and commit them. |
=== Required Documentation === | === Required Documentation === |
Latest revision as of 09:02, 17 July 2013
Contents
Schema.pm
- Required
- Edit the big data structure in FS/FS/Schema.pm and add your tables and columns
- The upgrade script will automatically handle new tables as well as new columns, removed columns and changes to columns and indices.
Skeleton class autogeneration
- For new tables. Optional but recommended. We're trying to save you work!
- Make sure the tables have been added to FS/FS/Schema.pm and run
make install-perl-modules
- From the root freeside directory, run
bin/generate-table-module tablename
for each table. Use the-n
option if you prefer not to have Mason load the table module. - Edit the resulting FS/FS/table.pm
- FS/MANIFEST is updated and FS/t/table.t is added. Don't forget to git add FS/FS/table.pm and FS/t/table.t and commit them.
Required Documentation
- For new tables: add to FS/FS.pm
Optional: Documentation looking for adopters or innovative autogeneration
- somehwat neglected: httemplate/docs/schema.html
- really neglected: httemplate/docs/schema.dia