Index: openacs-4/packages/ref-currency/sql/postgresql/ref-currency-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-currency/sql/postgresql/ref-currency-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-currency/sql/postgresql/ref-currency-drop.sql 15 Sep 2001 01:04:22 -0000 1.1 @@ -0,0 +1,26 @@ +-- Drop the ACS Reference Currency data +-- +-- @author jon@jongriffin.com +-- @cvs-id $Id: ref-currency-drop.sql,v 1.1 2001/09/15 01:04:22 donb Exp $ + +-- drop all associated tables and packages +-- I am not sure this is a good idea since we have no way to register +-- if any other packages are using this data. + +-- This will probably fail if their is a child table using this. +-- I can probably make this cleaner also, but ... no time today + +create function inline_0() returns integer as ' +declare + rec acs_reference_repositories%ROWTYPE; +begin + for rec in select * from acs_reference_repositories where upper(table_name) like ''CURRENC%'' loop + execute ''drop table '' || rec.table_name; + perform acs_reference__delete(rec.repository_id); + end loop; + return 0; +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + Index: openacs-4/packages/ref-us-counties/sql/postgresql/ref-us-counties-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-us-counties/sql/postgresql/ref-us-counties-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-us-counties/sql/postgresql/ref-us-counties-drop.sql 15 Sep 2001 01:04:22 -0000 1.1 @@ -0,0 +1,15 @@ + +create function inline_0() returns integer as ' +declare + rec acs_reference_repositories%ROWTYPE; +begin + for rec in select * from acs_reference_repositories where upper(table_name) like ''US_COUNTIES'' loop + execute ''drop table '' || rec.table_name; + perform acs_reference__delete(rec.repository_id); + end loop; + return 0; +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); + Index: openacs-4/packages/ref-us-states/sql/postgresql/ref-us-states-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ref-us-states/sql/postgresql/ref-us-states-drop.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ref-us-states/sql/postgresql/ref-us-states-drop.sql 15 Sep 2001 01:04:22 -0000 1.1 @@ -0,0 +1,15 @@ + +create function inline_0() returns integer as ' +declare + rec acs_reference_repositories%ROWTYPE; +begin + for rec in select * from acs_reference_repositories where upper(table_name) = ''US_STATES'' loop + execute ''drop table '' || rec.table_name; + perform acs_reference__delete(rec.repository_id); + end loop; + return 0; +end;' language 'plpgsql'; + +select inline_0(); +drop function inline_0(); +