[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 13:42:52 EST 2010


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