Update todo query

This commit is contained in:
thiloho
2024-01-04 16:26:33 +01:00
parent c0a1f059dc
commit 9508d529ae

View File

@@ -253,7 +253,7 @@
wantedBy = [ "timers.target" ]; wantedBy = [ "timers.target" ];
path = [ pkgs.postgresql_15 ]; path = [ pkgs.postgresql_15 ];
script = '' script = ''
psql -d todos -c "UPDATE user_todo SET is_overdue = true WHERE NOW() AT TIME ZONE 'CET' >= due_date AND is_completed = false AND is_overdue = false" psql -d todos -c "UPDATE user_todo SET is_overdue = true WHERE DATE_TRUNC('day', NOW() AT TIME ZONE 'CET') > due_date AND is_completed = false AND is_overdue = false"
''; '';
serviceConfig = { User = "postgres"; }; serviceConfig = { User = "postgres"; };
partOf = [ "todoapp.service" ]; partOf = [ "todoapp.service" ];