Forum OpenACS Development: creating upgrade scripts

Collapse
Posted by Vinod Kurup on
I found a simple bug in the CR (content_keyword__delete was broken). I logged it in the SDM and made a patch, but now I have a question.

Since this is a bug-fix, I assume it should go into the 4-5 tree (as opposed to the development tree). The next step is to make an upgrade-script. What is the naming convention for that? I notice some packages have separate 'upgrade' directories and some have the upgrade scripts directly in the sql directory. Does the APM care? I'm planning to call it upgrade-4.5b-4.5.sql since it's relevant for those who have installed 4.5beta and will upgrade to 4.5 when it's released.

For completeness, what if this patch was to go in the development branch. Would that change the naming scheme? I would guess that they would be called something like upgrade-4.5-4.6.sql since they would be used by people who have installed 4.5 and are upgrading to the next version.

Hopefully, I've kept this post technical enough to keep Talli out of it. 😊

Thanks!

Collapse
Posted by Don Baccus on
I suggest doing some testing with the APM - I've not played with, nor looked at, the upgrade facility.  Of course one of the ex-aDers or other folks with ACS 4.2 knowledge may have immediate suggestions.

Which, of course, will be technical enough to keep Talli out of the discussion.

Collapse
Posted by Vinod Kurup on
OK, I've looked around a little and it seems the APM will label scripts as db-upgrade scripts if they're placed in either place (alongside other datamodel scripts OR in a separate upgrade folder). So, I vote that we keep them in a separate 'upgrade' folder for prettiness-sake 😊

In the post above, I mentioned that the script should be called upgrade-4.5b-4.5.sql, but that is wrong. The entire OpenACS tarball has those version numbers, but the APM looks at the version number associated with the individual package. My fix is in acs-content-repository which, in the beta-tarball, is at version 4.1.2. So, I assume that we should update the .info file of acs-content-repository to 4.5 and then my script would be called upgrade-4.1.2-4.5.sql.

So, if you had a site running 4.5beta, you could replace your current code with the new 4.5 tarball (via brute-force or with CVS magic), and click on 'Install Packages' from the APM. The APM would then notice that certain packages had new version numbers in their .info files and would offer you the option to upgrade those packages, loading only the scripts that would upgrade you from 4.1.2 (eg) to 4.5.

Hope this helps someone besides myself 😊