diff --git a/supabase/migrations/20230907153748_add-crons.sql b/supabase/migrations/20230907153748_add-crons.sql new file mode 100644 index 00000000..d166ade0 --- /dev/null +++ b/supabase/migrations/20230907153748_add-crons.sql @@ -0,0 +1,17 @@ +select + cron.schedule ( + 'delete-old-access-points', + '@monthly', + $$ + delete from public.access_points_latest_states where updated_at < now() - interval '30 days'; + $$ + ); + +select + cron.schedule ( + 'delete-old-cron-logs', + '@weekly', + $$ + delete from cron.job_run_details where end_time < now() - interval '7 days'; + $$ + );