Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/236.canada.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue with the `datastore purge` command deleting custom Reference Tables.
13 changes: 13 additions & 0 deletions ckanext/datastore/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ def purge(list: bool = False, yes: bool = False):

site_user = logic.get_action('get_site_user')({'ignore_auth': True}, {})

# (canada fork only): skip underscored tables,
# skip public_table_search tables
# TODO: upstream contrib!!
public_search_tables = config.get('ckan.datastore.public_table_search', [])

resource_id_list = []
# (canada fork only): more options and state=deleted handling
# TODO: upstream contrib!!
Expand All @@ -166,6 +171,14 @@ def purge(list: bool = False, yes: bool = False):
if record['alias_of']:
continue

# (canada fork only): skip underscored tables,
# skip public_table_search tables
# TODO: upstream contrib!!
if record['name'] in public_search_tables:
continue
if record['name'].startswith('_'):
continue
Comment on lines +179 to +180

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is redundant on upstream because tables starting with _ are filtered from the _table_metadata view.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay cool, so upstream is fine basically? so no need to do an upstream commit?


# (canada fork only): more options and state=deleted handling
# TODO: upstream contrib!!
res = logic.get_action('resource_show')(
Expand Down
Loading