club-soda / club-soda-guide

Mindful Drinking Movement - Club Soda MVP 2.0
https://club-soda-guide-staging.herokuapp.com
17 stars 0 forks source link

Deleted venues remaining in database? #621

Closed jessyclubsoda closed 5 years ago

jessyclubsoda commented 5 years ago

Stumbled across this whilst cleaning up some data for a monthly analytics report

There are some venues which remain in the database (as downloadable from the website backend) which are no longer listed on the Guide. I assume they have been deleted but somehow aren't coming off the database? Is this the case for all deleted venues?

Furthermore, even though this venue now no longer existed on the live site I was unable to create a new one as we now (importantly) give venues unique slugs based on their postcodes so venues cannot be replicated. However, this is problematic in the case of a venue having previously been deleted but now wanting to rejoin the Guide. I am unable to add them to the Guide because the database still thinks that its original slug exists.

Advice much appreciated!

SimonLab commented 5 years ago

I assume they have been deleted but somehow aren't coming off the database?

That's right, the venues deleted have their deleted property in the database switch to true. This means that when an admin delete a venue, the database record the action of deletion but for safety and stats reasons we do not do a "hard delete" of the venue. It is useful and easy with this logic to restore a venue if a false manip was created.

as downloadable from the website backend @jessyclubsoda do you mean using the admin download UI: image

I've just tested this and deleted venues are not shown in the CSV file. Do you have an example of a deleted venue showing up? Or did you access the backend data in an other way?

I'm looking now at the how to add back a deleted venue.

SimonLab commented 5 years ago

@jessyclubsoda I've also manage to create a new venue with the same name and postcode as one deleted. I'm wondering if this issue hasn't been resolved already? Could you try to reproduce this error on your side on staging to be sure? Thanks

jessyclubsoda commented 5 years ago

Thanks for looking at this - I can't seem to recreate it either and can't exactly remember what it was in reference to so I'll close this issue for now. Cheers!