I have a site (https://bagelconcertfinder.com) that updates concert listings every night. During covid, a problem arose with the database. Shows were canceled or rescheduled constantly. My database checks for new events and adds them to the list but doesn’t delete canceled or rescheduled events.
Rather than build something that syncs the two datasets, I would rather run a new update like so:
- Create a temporary “Events” table.
- Run the updates against that temp table.
- Drop the current Events table.
- Rename the TempEvents to “Events”
I have seen all this before. I am not sure how to temporarily change the name of the Events table while I am populating it (via something like
MIX_ENV=prod mix run -e UpdateSiteData.start_data_update in a cron job)