Forum OpenACS Development: Re: 5.0 upgrade process requires Tcl Calls

Collapse
Posted by Vinod Kurup on
My site was already around 4.6.4, so I didn't run the 4.6.3-4.6.4 upgrade script.

I just loaded up my before-upgrade DB and got this:

testkurup=# select * from persons where person_id=0;
 person_id | first_names  | last_name
-----------+--------------+-----------
         0 | Unregistered | Visitor
(1 row)
 
testkurup=# select * from parties where party_id=0;
 party_id | email | url
----------+-------+-----
        0 |       |
(1 row)
So, I think you're right - you need to start around 4.6-4.6.1 where the party with party_id 0 gets created.
Collapse
Posted by Vinod Kurup on
Just found a problem with the upgrade. apm_package_version__delete and apm_package_version__copy were changed around 5.0d9, but the changes didn't get into an upgrade script. I've committed the changes to the upgrade script on the 5.0 branch, but if you've already upgraded, you need to 'create or replace' those 2 functions.
Collapse
Posted by Vinod Kurup on
Another problem: ref_timezones is now required by acs_lang, but didn't get installed on my system, so this bug shows up. acs_lang gets installed in the special zzz-postload.tcl script:
if {![apm_package_installed_p acs-lang]} {

    apm_package_install -enable -mount_path acs-lang [acs_root_dir]/packages/acs-lang/acs-lang.info
 
    lang::catalog::import -locales [list "en_US"]

}
But apparently, apm_package_install doesn't automatically resolve dependencies, so ref-timezones (and acs-reference) never got installed. Should we add 2 more checks to zzz-postload.tcl, checking for and installing acs-reference and ref-timezones if needed? or is there a better way to automatically install required dependencies?
Collapse
Posted by Vinod Kurup on
Sorry to flood this thread, but found another one. Running the auth_driver_get_param_values test (in acs-authentication) fails with this error:
ERROR:  duplicate key violates unique constraint "auth_driver_params_authority_id_key"
 
SQL:             
            insert into auth_driver_params (authority_id, impl_id, key, value)
            values ('12797', '12891', 'SnapshotURL', '0639DC91D')
My auth_driver_params table has a unique constraint on (authority_id, impl_id) whereas the version in 5.0 has a pk constraint on (authority_id, impl_id, key). The change is here. I only discovered this error by running the automated test - the system works fine otherwise.

I think this change happened between 5.0d4 and 5.0d5, but there's no upgrade script with that name. Here's the change that needs to be made:

alter table auth_driver_params drop constraint auth_driver_params_authority_id_key;
alter table auth_driver_params add constraint auth_driver_params_pk primary key (authority_id,impl_id,key)
Is it OK for me to create an upgrade-5.0d4-5.0d5 script?