Index: openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml,v diff -u -r1.38 -r1.39 --- openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 20 Sep 2004 19:42:41 -0000 1.38 +++ openacs-4/packages/acs-core-docs/www/xml/developers-guide/tutorial-advanced.xml 22 Sep 2004 17:47:36 -0000 1.39 @@ -1541,14 +1541,33 @@ - - Distributing upgrades of your package + + Writing upgrade scripts by Jade Rubick. - Not completed yet + 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 + 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 + 1.0b2. Commit all your changes, tag the release (as described here + in the advanced tutorial), and both new installations and upgrades + will be taken care of. + Future Topics