Add scheduling columns to PEP schedules
What does this MR do and why?
This MR adds a list of schedules to the WIP policy type pipeline_execution_schedule_policy. It also truncates the security_pipeline_execution_project_schedules table and adds scheduling columns to the table.
We are iterating on a new undocumented policy type that's the scheduled counterpart to the existing Pipeline execution policies. Currently, this policy type only supports a single top-level cadence, which we're here replacing with a list of schedules. This is also the reason why we're dropping the unique index over (project_id, security_policy_id), since multiple schedules may now apply to the same project.
Rows are idempotently written to the security_pipeline_execution_project_schedules table when a policy of this type gets linked or edited. We periodically iterate over the table and enqueue pipeline execution workers for every due schedule.
Why truncate the table and not backfill it
The table was introduced in the previous milestone by !175246 (merged) and writes to it are behind a feature flag. The policy type is new and undocumented. We only have 2 rows in the table (postgres.ai) resulting from feature verification and we don't expect any rows on self-managed installs.
Since this is an undocumented policy type behind a feature flag, and the rows are easily recreated by relinking or editing the policy, and the consequence of truncating the table are benign (we won't iterate over any previously existing rows), instead of backfilling our own two rows, this MR truncates the table in order to add new NOT NULL columns.
Refer to !180714 (merged) which will write to the columns introduced here.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #504598 (closed)