urban-farming-co / TableFarm

The repo for the website and image processing
http://tablefarm.co.uk
0 stars 0 forks source link

Images are stored for too long #7

Open kazzacarrot opened 7 years ago

kazzacarrot commented 7 years ago

Make a node job that will trigger at 1amGMT and will delete images. Leaving only one per device per day where the light level was at a peak.

kazzacarrot commented 7 years ago

I think this is the desired query:
Update table set image = null HAVING lightluxlevel <> max(lightLuxLevel) GROUP BY time::date

I'm just not sure.

kazzacarrot commented 7 years ago

To delete all images: update table set image = null

ie. update urbanfarming.processeddata set image = null

kazzacarrot commented 7 years ago

To delete all images where light lux level < 10000: update table set image = null where lightluxlevel < 1000

ie. update urbanfarming.livedateyo set image = null where lightluxlevel < 1000