schedule
A reusable schedule definition.
Primary Key:Checks:schedule_has_trigger-((run_after_schedule_id IS NOT NULL) OR ((cron IS NOT NULL) <> (interval_type IS NOT NULL)))schedule_interval_positive-(("interval" IS NULL) OR ("interval" > 0))schedule_interval_type_and_interval_set_together-((interval_type IS NULL) = ("interval" IS NULL))schedule_minutes_sets_minutes_are_from_completion_time-((interval_type = 'minutes'::claims.schedule_interval_type) = (minutes_are_from_completion_time IS NOT NULL))schedule_monthly_sets_days_of_month-((interval_type = 'monthly'::claims.schedule_interval_type) = ((days_of_month IS NOT NULL) AND (cardinality(days_of_month) >= 1)))schedule_on_days_sets_time_of_day-((interval_type = ANY (ARRAY['daily'::claims.schedule_interval_type, 'weekly'::claims.schedule_interval_type, 'monthly'::claims.schedule_interval_type])) = ((times_of_day IS NOT NULL) AND (cardinality(times_of_day) >= 1)))schedule_weekly_sets_days_of_week-((interval_type = 'weekly'::claims.schedule_interval_type) = ((days_of_week IS NOT NULL) AND (cardinality(days_of_week) >= 1)))
created_by=>login.login_idrun_after_schedule_id=>schedule.schedule_id
schedule_created_by_idx-created_byschedule_run_after_schedule_id_idx-run_after_schedule_id
| Column | Data Type | Nullable | Indexed | Description |
|---|---|---|---|---|
schedule_id | bigint | No | Yes | Snowflake ID for the schedule. |
run_after_schedule_id | bigint | Yes | Yes | Optional link to another schedule that this one runs after. When set, interval_type/interval/cron may all be null, meaning this schedule runs immediately after the referenced schedule's job completes. |
cron | text | Yes | No | Optional standard cron expression. Mutually exclusive with interval_type: a schedule uses either the structured interval columns or a cron expression, not both. |
interval_type | schedule_interval_type | Yes | No | The unit for `interval`: minutes, daily, weekly, or monthly. Null when the schedule is cron-based or only runs after another schedule. |
interval | bigint | Yes | No | Run every N units of `interval_type`. Must be > 0. Null exactly when interval_type is null. |
minutes_are_from_completion_time | boolean | Yes | No | Set when interval_type = 'minutes': if true, the next run is scheduled the specified number of minutes after the last job completes; otherwise, intervals are measured from the last scheduled time. NULL on non-minutes schedules. |
days_of_week | day_of_week_type[] | Yes | No | Set when interval_type = 'weekly' |
days_of_month | claims.day_of_month_type[] | Yes | No | Set when interval_type = 'monthly' days of month as 1..31. NULL otherwise. |
times_of_day | claims.time_of_day_type[] | Yes | No | Clock times the schedule runs at, applies to daily, weekly, and monthly intervals. |
last_ran_at | timestamp with time zone | Yes | No | The last time the schedule was ran. Important for accounting for service restarts that may otherwise break consistent scheduling timing (e.g. with minutes_are_from_completion_time). |
created_by | bigint | No | Yes | A foreign key to the login row for the user that created the schedule. |
created_at | timestamp with time zone | No | No | The time the schedule was created. |