DurhamARC / ManyFEWS

The Many Flood Early Warning System
GNU General Public License v3.0
7 stars 3 forks source link

check Zentra DB for existing data. #84

Open Abel-Durham opened 2 years ago

Abel-Durham commented 2 years ago

If the initial model be run more than one time, it will duplicate downloading values in the DB. Therefore, we need to add a function to double check it exists or not. Maybe something like:

SELECT MAX(date) from calculations_zentrareading;

to retrieve maximum value, e.g.

           max           
------------------------
 2022-09-19 23:55:00+00

We can then limit the query to the zentra API to only retrieve data after this date