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
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:
to retrieve maximum value, e.g.
We can then limit the query to the zentra API to only retrieve data after this date