Skip to content

Commit

Permalink
Add cleanup cron jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Siilwyn committed Sep 15, 2023
1 parent e7257dd commit 2c67520
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions supabase/migrations/20230907153748_add-crons.sql
Original file line number Diff line number Diff line change
@@ -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';
$$
);

0 comments on commit 2c67520

Please sign in to comment.