sidstamm / energymonitor

Monitors energy usage (and production) and displays reports through a web site.
Mozilla Public License 2.0
3 stars 0 forks source link

merge new weather data #7

Open sidstamm opened 5 years ago

sidstamm commented 5 years ago

Currently when weather data is downloaded and imported to the database, it completely replaces the wx sqlite table.

https://github.com/sidstamm/energymonitor/blob/6a4bf8d8c8f015fc4952f101fb0e72ef543366e0/probes/getweatherintodb.sh#L23

We should update this so new weather data is added but the old data is only replaced if the newly downloaded data duplicates it. Maybe something like DELETE FROM wx WHERE YEAR=XXX or something.