fact-project / shifthelper

So we can sleep at night.
4 stars 0 forks source link

Make cloning the db atomic, no more shifthelper mysql exceptions #225

Closed maxnoe closed 7 years ago

maxnoe commented 7 years ago

The trick is to not just replace using pandas (which does DROP TABLE, CREATE TABLE, INSERT stuff) but save the new table into a temporary table and the rename it to the correct name. Renaming is atomic und thus does not lead to an exception like table does not exist