Forum OpenACS Q&A: database package-drop script

Collapse
Posted by Eric Wolfram on
I'm trying to manually drop a package that was partially installed. I run the drop scripts manually from the command line:

psql -f notifications-package-drop.sql -U postgres mytlc

When I go to the install tool, I still get these errors trying to install notifications.

psql:notification-type-sc-create.sql:71: ERROR:  Cannot insert a duplicate key into unique index acs_sc_contracts_name_un
psql:delivery-method-sc-create.sql:71: ERROR:  Cannot insert a duplicate key into unique index acs_sc_contracts_name_un
psql:email-sc-impl-create.sql:66: ERROR:  Cannot insert a duplicate key into unique index acs_sc_impl_alias_un

    invoked from within
"db_source_sql_file -callback

I also ran that psql -f thing on notifications-drop.sql and notifications-core-drop.sql

I hope that I haven't completely squished my database yet...any thoughts...I'm out of them again...

Collapse
Posted by Eric Wolfram on
notification_type__new

is one of the duplicate errors.

[ewolfram@rhumba postgresql]$ find /web/mytlc -type f -name "*.sql" | xargs grep \
notification_type__new

Okay, now almost ever file below corrisponds to an application that is broken on the site...all those apps are choking on "notification::display::request_widget". I'm in way over my head here because I never used a database like this before...so I'm going to each of those directories and running the drop script that go with the ones mentioned in these errors.

/web/mytlc/packages/bug-tracker/sql/postgresql/bug-tracker-notifications-init.sql\
:        v_foo:= notification_type__new (
/web/mytlc/packages/bug-tracker/sql/postgresql/bug-tracker-notifications-init.sql\
:        v_foo:= notification_type__new (
/web/mytlc/packages/forums/sql/postgresql/forums-notifications-init.sql:        v\
_foo:= notification_type__new (
/web/mytlc/packages/forums/sql/postgresql/forums-notifications-init.sql:        v\
_foo:= notification_type__new (
/web/mytlc/packages/lars-blogger/sql/postgresql/notifications-init.sql:        v_\
foo:= notification_type__new (
/web/mytlc/packages/notifications/sql/postgresql/notifications-package-create.sql\
:select define_function_args ('notification_type__new','type_id,sc_impl_id,short_\
name,pretty_name,description,creation_date,creation_user,creation_ip,context_id')\
;
/web/mytlc/packages/notifications/sql/postgresql/notifications-package-create.sql\
:create function notification_type__new (integer,integer,varchar,varchar,varchar,\
timestamp,integer,varchar,integer)
/web/mytlc/packages/notifications/sql/postgresql/notifications-package-drop.sql:d\
rop function notification_type__new (integer,varchar,varchar,varchar,timestamp,in\
teger,varchar,integer);
/web/mytlc/packages/survey/sql/postgresql/survey-notifications-init.sql:        v\
_foo:= notification_type__new (