Forum OpenACS Development: Figuring out the package_id in upgrade scripts?

I'm currently making organizations and project-manager subsite aware. In each of the upgrade scripts I am going to need to add pacakge_id columns. How do I populate these columns with the correct package_id?
using the context_id of your objects?
Collapse
Posted by Dave Bauer on
THis really depends on how the package is setup.

Somewhere you'd need a "parent" object that tells you the hierarchy of objects in your package.

Like Rocael said, if the context_id is set to the package_id, that might help out.

Collapse
Posted by Alex Kroman on
select context_id from acs_objects where object_type = 'organization' gives the right package_id for organizations.

for project-manager (thanks to daveb):

SELECT
package_id
FROM
cr_folders
WHERE
description = 'Project Repository'
LIMIT 1

Gets the right ID.

select context_id from acs_objects where object_type = 'logger_project' limit 1 also seems to work.

Any preference on how to get the package_id for project manager?

Collapse
Posted by Malte Sussdorff on
No answer to your questions, but with the HEAD version we made PM and organizations subsite aware using the acs_object's package_id paramter. Maybe, if you have a chance, you could switch to 5.2 before making your changes?