CKAN: automatically deletes data warehouse tables when a resource is deleted

I have a ckan instance configured with the filestore, datastore and datapusher plugins enabled.

When I create a new resource, the datapusher plugin correctly adds a new table to datasoredb and populates it with data.

But if I update the resource, a new datapusher task starts, and everything updates correctly. In another ckan instance with the resource associated with it, I need to manually start the task, but everything works fine.

The problem occurs if I delete the resource. Data warehouse tables are still available, and even the file link is still active.

Is there a way to configure it to automatically save each resource trace ??? I mean, delete files from filestore, tables from data store, api, links, etc.

+4
source share
2 answers

I partially confirmed this behavior of http://demo.ckan.org , which is currently ckan_version: "2.4.1"

  • Create Resource
  • Request resource via data pusher
  • Delete Resource
  • Accessing the query resource via datastore_search API -> still works.
  • An attempt to access the resource file → 404 was not found.

Will be displayed as an error.

Perhaps delete it? http://docs.ckan.org/en/latest/maintaining/datastore.html#ckanext.datastore.logic.action.datastore_delete

0
source

This is possible through the CLI:

sudo -u postgres psql datastore_default (, datastore_default postgres ).

THEN ( ):

\dt

THEN

DROP TABLE "{RESOURCE ID}";

( {RESOURCE ID} UUID)

0

All Articles