Forum OpenACS Development: Re: Minor Error in Survey Package after upgrading

Collapse
Posted by Gustaf Neumann on
The upgrade script can change the database in arbitrary ways (adding/deleting tuples/attributes/tables, ... and functions), so there is not much we can actually do to determine automatically, how much was executed. Keeping track of the names of the upgrade scripts could just help in the future, but of course not for not for the past (i.e. your case)...

The problem is especially bad, when one upgrades from really old versions, and an early upgrade script fails.

Yes, I suppose there is no easy solution but it might help to upgrade old versions (but it depends of every customer).

Ideally, I think the best approach would be abort the upgrade based in:
1. Some error (catching error from psql)
2. Some checking (versions or some audits as table approach you've mentioned)

I don't, only some ideas. Any way, perhaps I'm the only one with this problem and it doesn't worth :-)

Collapse
Posted by Patrick Giagnocavo on
It would take some work, but I would think you could wrap each SQL statement with something that stuffed the SQL statement into a table with a timestamp, and a result code . Then you would have a record of all SQL run during the upgrade process and whether it threw an error or not.
Yes, as Gustaf said before perhaps this is the better approach. It could be useful in upgrading older versions