tsdataclinic / scout

Scout is a data discovery tool to explore open data portals worldwide.
https://scout.tsdataclinic.com
Apache License 2.0
33 stars 12 forks source link

Changed hard delete to soft delete for datasets in postgres #350

Closed jps327 closed 1 year ago

jps327 commented 1 year ago

Summary

Replace hard-delete with soft-delete when a dataset can no longer be found in Socrata. This marks a dataset as deleted without actually removing it. This allows us to still show this dataset in collections and allows us to restore the dataset if the dataset becomes available in Socrata. This happens frequently because Socrata's API regularly drops dataset ids during batch calls, so it's not 100% reliable to always retrieve every dataset that exists, so it's common for a dataset to appear deleted during one data ingestion process, only to then be restored in the next one. If we used hard-deletes this would be an incredibly inconvenient process.

Screenshots or Videos (if applicable)

n/a

Related Issues

Closes #342

Test Plan

  1. Run yarn seed-database-dev and verify if any datasets that get deleted now have their deletedAt column populated

Checklist Before Requesting a Review