[ckan-dev] Deleting harvest source
Stefan Oderbolz
stefan.oderbolz at liip.ch
Wed Oct 2 12:20:54 UTC 2013
Sure:
1. Clear all datasets that you harvested using that harvest source (this
makes it a little bit easier as you don't have to delete the datasets in
the database directly). You can do this in the admin panel on the website
(/harvest/admin/<harvester-name>)
2. Find the id of the harvester (there are several ways to do this,
including a paster command: paster --plugin=ckanext-harvest harvester
sources -c <config-file>)
select * from harvest_source;
e.g. in my case => f35f3b15-ab6d-4b81-b426-d2f73e3f1c96
3. Start deleting related records (the order matters!):
delete from harvest_source where id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96'; (if this fails, then you probably
did not clear the harvest source before)
delete from package_revision where id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from package_extra_revision where package_id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from package_extra where package_id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from package_role where package_id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from resource_group_revision where package_id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from resource_group where package_id =
'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
delete from package where id = 'f35f3b15-ab6d-4b81-b426-d2f73e3f1c96';
4. You're done, now you should be able to create a new harvest source with
the same URL.
Best Regards Stefan
On Wed, Oct 2, 2013 at 11:50 AM, Ryan Maine <balrogmi at msn.com> wrote:
> Could you put an example of the queries you execute to do it?
>
> Thanks
>
> 2013/10/1 Stefan Oderbolz <stefan.oderbolz at liip.ch>:
> > As far as I know there is no such thing at the moment (if there is I'm
> very
> > interested myself).
> > I used to delete the harvest source manually from the database.
> >
> >
> > On Tue, Oct 1, 2013 at 3:41 PM, Ryan Maine <balrogmi at msn.com> wrote:
> >>
> >> How can I delete from the database a harvest source? If I try to
> >> create a harvest source with the same URL or name than one previously
> >> deleted, this message appears
> >>
> >> - URL: There already is a Harvest Source for this URL
> >> - Name: That URL is already in use.
> >>
> >> I know there is an API to purge groups and organizations but, what
> >> about harvest sources?
> >>
> >> Regards
> >>
> >> _______________________________________________
> >> ckan-dev mailing list
> >> ckan-dev at lists.okfn.org
> >> http://lists.okfn.org/mailman/listinfo/ckan-dev
> >> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >
> >
> >
> >
> > --
> > Liip AG // Feldstrasse 133 // CH-8004 Zurich
> > Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
> >
> > _______________________________________________
> > ckan-dev mailing list
> > ckan-dev at lists.okfn.org
> > http://lists.okfn.org/mailman/listinfo/ckan-dev
> > Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
> >
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>
--
Liip AG // Feldstrasse 133 // CH-8004 Zurich
Tel +41 43 500 39 80 // GnuPG 0x7B588C67 // www.liip.ch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20131002/03eecc85/attachment-0001.html>
More information about the ckan-dev
mailing list