Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always remove deleted submissions entirely instead of merely marking them as deleted #732

Merged
merged 5 commits into from
Jun 15, 2021

Conversation

jnm
Copy link
Member

@jnm jnm commented Jun 14, 2021

Description

When deleting submissions through the legacy view (but not via the API), a special marker was applied to the "deleted" submissions instead of removing them outright. This meant that every query to retrieve submitted data needed to filter out submissions having this marker. We now always remove submissions outright when deleting and therefore no longer need this extra filter, which caused high database overhead.

Related issues

Closes #696
Related to kobotoolbox/kpi#3287

@jnm jnm force-pushed the stop-querying-deleted-at branch from f6145eb to 9e2a78a Compare June 14, 2021 22:58
@jnm jnm changed the title Stop querying deleted at Always remove deleted submissions entirely instead of merely marking them as deleted Jun 14, 2021
@jnm jnm marked this pull request as ready for review June 14, 2021 23:02
 # Conflicts:
 #	onadata/apps/logger/management/commands/sync_deleted_instances_fix.py
 #	onadata/apps/logger/models/instance.py
 #	onadata/apps/logger/tests/test_command_syncd_deleted_instances_fix.py
 #	onadata/apps/main/tests/test_form_api_delete.py
 #	onadata/apps/main/views.py
 #	onadata/apps/survey_report/views.py
 #	onadata/apps/viewer/management/commands/update_delete_from_mongo.py
 #	onadata/apps/viewer/models/parsed_instance.py
 #	onadata/apps/viewer/pandas_mongo_bridge.py
 #	onadata/libs/utils/export_tools.py
@jnm
Copy link
Member Author

jnm commented Jun 15, 2021

@noliveleger thanks for making this work with KoBoCAT 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deleted_at (Postgres) and _deleted_at (Mongo)
2 participants