Index: openacs-4/packages/acs-core-docs/www/tutorial-upgrade-scripts.html =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/tutorial-upgrade-scripts.html,v diff -u -r1.11 -r1.11.2.1 --- openacs-4/packages/acs-core-docs/www/tutorial-upgrade-scripts.html 8 Nov 2017 09:42:12 -0000 1.11 +++ openacs-4/packages/acs-core-docs/www/tutorial-upgrade-scripts.html 2 Mar 2019 19:30:06 -0000 1.11.2.1 @@ -1,27 +1,18 @@ -Writing upgrade scripts

Writing upgrade scripts

- - <authorblurb> -

by Jade Rubick

- </authorblurb>
-

If your package changes its data model, you have to write an - upgrade script. This is very easy in OpenACS.

- -

First, you want to make sure you change the original .sql - file so that new installation will have the new data model.

- -

Next, check what version your package is currently at. For +Writing upgrade scripts

Writing upgrade scripts

by Jade Rubick

+ OpenACS docs are written by the named authors, and may be edited + by OpenACS documentation staff. +

If your package changes its data model, you have to write an + upgrade script. This is very easy in OpenACS.

First, you want to make sure you change the original .sql + file so that new installation will have the new data model.

Next, check what version your package is currently at. For example, it may be at version 1.0b1. Create a file in - sql/postgres/upgrade called packagename-1.0b1-1.0b2.sql and put + yourpackage/sql/postgres/upgrade called packagename-1.0b1-1.0b2.sql and put the SQL code that will update the data model. For example, if you add in a column, you would have an alter table add column statement in this file. Test this out very well, because data model changes are more serious and fundamental changes than the - program .tcl files.

- -

Now use the APM to create a new package version + program .tcl files.

Now use the APM to create a new package version 1.0b2. Commit all your changes, tag the release (the section called “Distributing upgrades of your package”), and both new installations and upgrades - will be taken care of.

-
+ will be taken care of.