Forum OpenACS Development: Re: Accidently updated news-aggregator => Big Pain...

Collapse
Posted by Dave Bauer on
Malte,

The idea that a source belongs to only one instance of news aggregator is wrong. A source could be associated with any instance of news aggregator, so if for instance, I remove on instance of news aggreagtor, the source could still be used by other instances, and the row should not be removed when the package instance is removed.

Exactly. So, no, I'm not going to write that upgrade script because it will break the package as it works now. Also, for clarification, the package_id column in na_sources was NOT being used in new installations - every row in my na_sources table has a null in the package_id column. It appeared useless and confusing. I haven't dug through the CVS logs to see who made that change and why but the bottom line is that there was no reason to believe dropping the column would have any effect.

I haven't worked with the portlet architecture but I think the right thing to do would be to add an aggregator_id attribute to the portlet and let the portlet query the DB the same way the full package does, i.e., pull all items belonging to the aggregator_id and sort by date, then source. I'm willing to help sort this out but as I said above, I don't have a portal or .LRN installation to work on.

Nima - yeah, it's still going to be an issue. You can avoid the problem by avoiding the upgrade or by running the 0.9.7-0.9.8 upgrade script by hand and omitting "alter table na_sources drop package_id".

Dave, Michael, I totally agree with you. But dropping a column in a databse script without making sure that the data in the column is preserved is bad. Seriously. I don't care about news-aggregator. We don't use it and I got this to work at a client site after upgrade. My only point is: Don't drop database columns *unless* you provide an upgrade script which stores the column value somewhere else.

Michael, can you answer me the question why it is mandatory that the package_id is dropped from na_sources? It obviously will break *any* .LRN upgrade that is using news-aggregator. Whereas if we just keep the package_id, news-aggregator would still run.