[OPEN-ILS-GENERAL] How can we delete Org Units with SQL for EG 2.0 beta3

Jason Stephenson jstephenson at mvlc.org
Wed Dec 1 16:11:05 EST 2010


Quoting Repke de Vries <repke at xs4all.nl>:

> Jason
>
> from your answers to the original thread I take it  you also did the  
> Org Structure rebuilding with SQL but maybe you or someone else can  
> nevertheless help with the following before I try your approach:

I set up the org_units with SQL, so I can't help you there.

You could have used the cgi bootstraps for this, but they are gone, at  
least in trunk and 2.0. This was the one thing that they were really  
good for.


>
> after getting rid of everything I want to rebuild our new Org Units  
> structure through the staff client.
>
> This presupposes that I can still register a workstation - which  
> with everything gone can only happen at the untouched Consortium  
> level. Correct ?

You can try it. I've never tried that.

Jason


>
> This then would mean (and before deleting anything) that first I  
> should have checked  (through the Staff Client with default BR1  
> Workstation Registration) the tick box  "Can Have Users"  for the  
> Org Unit Type Consortium ?
>
> Otherwise I would cut off the branch I am sitting on Workstation  
> wise, have no alternative Workstation Registration option and can  
> never access Evergreen anymore through the Staff Client ;-)
>
> Confirmation and advice appreciated,
>
> Repke
>
>
> Op 1-dec-2010, om 19:42 heeft Jason Stephenson het volgende geschreven:
>
>> Repke,
>>
>> Try this:
>>
>> BEGIN;
>> DELETE FROM actor.org_unit WHERE id > 1;
>> DELETE FROM actor.org_address WHERE id > 1;
>> COMMIT;
>>
>> The above gets rid of everything but the sample consortium.
>>
>> HtH,
>> Jason
>>
>>
>> Quoting Repke de Vries <repke at xs4all.nl>:
>>
>>> Hi all
>>>
>>> this is a repost of a previous thread [1] now focussing on the  following:
>>>
>>> deleting Organisational Units is different in 2.0 from 1.6 and can  
>>>  not be achieved through the Staff Client.
>>>
>>> The only information how to do it directly in the database with  
>>> SQL  comes from 1.6 documentation [2] and does indeed not work for  
>>> 2.0:  this is what I get back in psql:
>>> "..
>>> evergreen=# delete from actor.org_unit where shortname = 'BR4' ;
>>> ERROR:  update or delete on table "org_unit" violates foreign key   
>>> constraint "org_address_org_unit_fkey" on table "org_address"
>>> DETAIL:  Key (id)=(7) is still referenced from table "org_address".
>>> evergreen=#
>>> .."
>>>
>>> Can someone tell me what I should do (this will also help 2.0 DIG   
>>> documenting)?
>>>
>>> Either exclusively SQL or in some combination with the Staff  
>>> Client  Administrator functionality?
>>>
>>> Thanks, Repke, IISH
>>>
>>> [1]
>>> http://georgialibraries.markmail.org/search/?q=Unexpected+results  
>>> +changing+Organisational+Units+through+Staff+Client+in+EG+2.0  
>>> +alpha4#query:Unexpected%20results%20changing%20Organisational%20Units  
>>> %20through%20Staff%20Client%20in%20EG%202.0%20alpha4+page:1  
>>> +mid:t3qerg3qbws34hat+state:results
>>> [2]
>>> http://www.open-ils.org/dokuwiki/doku.php?id=evergreen-admin:policies:ou
>>>
>>>
>>
>>
>
>




More information about the Open-ils-general mailing list