Overview
PF-83 introduced two new tables and extendedpf_module_settings with SLA-related configuration columns. The migration was applied via the Supabase MCP execute_sql tool — no .sql file exists on disk in supabase/migrations/.
Tables Created
pf_sla_definitions (20 columns)
pf_sla_instances (21 columns)
RLS Policies
Both tables have RLS enabled with policies using thepf_has_org_access(organization_id) SECURITY DEFINER function:
- SELECT: Authenticated users with org access
- INSERT: Authenticated users with org access
- UPDATE: Authenticated users with org access,
WITH CHECKclause - DELETE: Authenticated users with org access
Settings Columns Added to pf_module_settings
SLA-related configuration is stored in the existing pf_module_settings table via its custom_fields JSONB column. No new columns were added to the table schema.
Rollback Procedure
To remove PF-83 tables (destructive — all SLA data will be lost):Warning: This is irreversible. Back up data before executing.
Notes
- No
.sqlmigration file on disk — The migration was applied directly via Supabase MCPexecute_sql. This is a known limitation of the Lovable workflow. The schema is in the live database and reflected intypes.ts. - PF-84 dependency — Business calendar-aware deadline calculation is deferred until PF-84 is implemented. Current deadlines use simple interval math.
- Edge function
pf-sla-checker— Deferred to Phase 2. Will provide server-side periodic breach detection.