thewca / statistics

12 stars 16 forks source link

Use transactions for database dump restore #112

Closed campos20 closed 1 month ago

campos20 commented 1 month ago

This aims to fix an issue we are having. The database dump update is stuck, even considering that the process is still running.

I think I did not know about transactions when I coded the scripts part. This project was using the strange approach of creating a temp database, performing restoring the dump on it, then rename columns from the temp database to the wca_development one. The issue I was trying to solve when I coded this is the same that we solve when using transactions. So, we are removing the creative way of doing this and we are starting to use transactions.

campos20 commented 1 month ago

Tests are breaking due to a unrelated code. The change to fix these tests were introduced in https://github.com/thewca/statistics/pull/113

campos20 commented 1 month ago

This code also includes https://github.com/thewca/statistics/pull/113.