Generated by npm run db:docs:generate — DO NOT EDIT BY HAND. Change the schema via a migration, then regenerate.
Core: hr_ · Tables: 188 · Source generated: 2026-06-10T02:55:32.169Z
Entity relationships
Tables
hr_aca_compliance
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_aca_compliance_delete(DELETE)hr_aca_compliance_insert(INSERT)hr_aca_compliance_select(SELECT)hr_aca_compliance_update(UPDATE)
hr_aca_employee_coverage
RLS: ✅ enabled (4 policies)
Foreign keys:
aca_compliance_id→hr_aca_compliance(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_aca_employee_coverage_delete(DELETE)hr_aca_employee_coverage_insert(INSERT)hr_aca_employee_coverage_select(SELECT)hr_aca_employee_coverage_update(UPDATE)
hr_analytics_cache
HR-18: Caches expensive analytics computations with TTL
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)
hr_analytics_cache_delete_policy(DELETE)hr_analytics_cache_insert_policy(INSERT)hr_analytics_cache_select_policy(SELECT)hr_analytics_cache_update_policy(UPDATE)
hr_applications
HR-09: Job applications linking candidates to postings
RLS: ✅ enabled (4 policies)
Foreign keys:
candidate_id→hr_candidates(id)created_by→pf_profiles(id)job_posting_id→hr_job_postings(id)organization_id→pf_organizations(id)rejected_by→pf_profiles(id)screened_by→pf_profiles(id)updated_by→pf_profiles(id)
hr_applications_delete(DELETE)hr_applications_insert(INSERT)hr_applications_select(SELECT)hr_applications_update(UPDATE)
hr_availability_preferences
HR-04: Employee availability patterns
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
Employees and HR admins can delete availability(DELETE)Employees and HR admins can insert availability(INSERT)Employees and HR admins can update availability(UPDATE)Users can view org availability preferences(SELECT)
hr_background_check_providers
Background check provider configuration per organization
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_background_check_providers_delete(DELETE)hr_background_check_providers_insert(INSERT)hr_background_check_providers_select(SELECT)hr_background_check_providers_update(UPDATE)
hr_background_check_webhook_dlq
Dead Letter Queue for failed background check webhook processing
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)original_webhook_id→hr_background_check_webhooks(id)resolved_by→pf_profiles(id)updated_by→pf_profiles(id)
hr_background_check_webhook_dlq_delete(DELETE)hr_background_check_webhook_dlq_insert(INSERT)hr_background_check_webhook_dlq_select(SELECT)hr_background_check_webhook_dlq_update(UPDATE)
hr_background_check_webhooks
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)dlq_id→hr_background_check_webhook_dlq(id)hr_background_check_id→hr_background_checks(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_background_check_webhooks_deny_delete(DELETE)hr_background_check_webhooks_insert(INSERT)hr_background_check_webhooks_select(SELECT)hr_background_check_webhooks_update(UPDATE)
hr_background_checks
Stores Checkr background check records for HR/ATS candidates
RLS: ✅ enabled (4 policies)
Foreign keys:
adverse_action_actor_id→users(id)created_by→pf_profiles(id)hr_application_id→hr_applications(id)hr_candidate_id→hr_candidates(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_background_checks_delete(DELETE)hr_background_checks_insert(INSERT)hr_background_checks_select(SELECT)hr_background_checks_update(UPDATE)
hr_benefits_dependents
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)verification_document_id→pf_documents(id)verified_by→pf_profiles(id)
hr_benefits_dependents_delete(DELETE)hr_benefits_dependents_insert(INSERT)hr_benefits_dependents_select(SELECT)hr_benefits_dependents_update(UPDATE)
hr_benefits_eligibility_rules
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)plan_id→hr_benefits_plans(id)updated_by→pf_profiles(id)
hr_benefits_eligibility_rules_delete(DELETE)hr_benefits_eligibility_rules_insert(INSERT)hr_benefits_eligibility_rules_select(SELECT)hr_benefits_eligibility_rules_update(UPDATE)
hr_benefits_enrollment_dependents
RLS: ✅ enabled (4 policies)
Foreign keys:
dependent_id→hr_benefits_dependents(id)enrollment_id→hr_benefits_enrollments(id)organization_id→pf_organizations(id)
hr_benefits_enrollment_dependents_delete(DELETE)hr_benefits_enrollment_dependents_insert(INSERT)hr_benefits_enrollment_dependents_select(SELECT)hr_benefits_enrollment_dependents_update(UPDATE)
hr_benefits_enrollments
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)enrollment_period_id→hr_benefits_open_enrollment_periods(id)organization_id→pf_organizations(id)plan_id→hr_benefits_plans(id)updated_by→pf_profiles(id)
hr_benefits_enrollments_delete(DELETE)hr_benefits_enrollments_insert(INSERT)hr_benefits_enrollments_select(SELECT)hr_benefits_enrollments_update(UPDATE)
hr_benefits_guides
HR-11: Benefits guide documents uploaded per organization and optionally linked to enrollment periods
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)enrollment_period_id→hr_benefits_open_enrollment_periods(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)uploaded_by→pf_profiles(id)
hr_benefits_guides_delete(DELETE)hr_benefits_guides_insert(INSERT)hr_benefits_guides_select(SELECT)hr_benefits_guides_update(UPDATE)
hr_benefits_life_events
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)reviewed_by→pf_profiles(id)updated_by→pf_profiles(id)
hr_benefits_life_events_delete(DELETE)hr_benefits_life_events_insert(INSERT)hr_benefits_life_events_select(SELECT)hr_benefits_life_events_update(UPDATE)
hr_benefits_open_enrollment_periods
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_benefits_open_enrollment_periods_delete(DELETE)hr_benefits_open_enrollment_periods_insert(INSERT)hr_benefits_open_enrollment_periods_select(SELECT)hr_benefits_open_enrollment_periods_update(UPDATE)
hr_benefits_plans
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)plan_document_id→pf_documents(id)summary_document_id→pf_documents(id)updated_by→pf_profiles(id)
hr_benefits_plans_delete(DELETE)hr_benefits_plans_insert(INSERT)hr_benefits_plans_select(SELECT)hr_benefits_plans_update(UPDATE)
hr_candidate_communications
HR candidate communication audit log. TCPA/compliance requires preservation - soft-delete or archive only.
RLS: ✅ enabled (4 policies)
Foreign keys:
application_id→hr_applications(id)candidate_id→hr_candidates(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)template_id→hr_communication_templates(id)updated_by→pf_profiles(id)
hr_candidate_communications_delete(DELETE)hr_candidate_communications_insert(INSERT)hr_candidate_communications_select(SELECT)hr_candidate_communications_update(UPDATE)
hr_candidate_eeo_data
HR-09: Restricted EEO demographic data separate from general candidate profile access.
RLS: ✅ enabled (4 policies)
Foreign keys:
candidate_id→hr_candidates(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_candidate_eeo_data_delete(DELETE)hr_candidate_eeo_data_insert(INSERT)hr_candidate_eeo_data_select(SELECT)hr_candidate_eeo_data_update(UPDATE)
hr_candidate_portal_accounts
RLS: ✅ enabled (4 policies)
Foreign keys:
candidate_id→hr_candidates(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_candidate_portal_accounts_delete(DELETE)hr_candidate_portal_accounts_insert(INSERT)hr_candidate_portal_accounts_select(SELECT)hr_candidate_portal_accounts_update(UPDATE)
hr_candidate_portal_sessions
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)portal_account_id→hr_candidate_portal_accounts(id)
hr_candidate_portal_sessions_delete(DELETE)hr_candidate_portal_sessions_insert(INSERT)hr_candidate_portal_sessions_select(SELECT)hr_candidate_portal_sessions_update(UPDATE)
hr_candidates
HR-09: Candidate master records (one per email per org)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_candidates_delete(DELETE)hr_candidates_insert(INSERT)hr_candidates_select(SELECT)hr_candidates_update(UPDATE)
hr_career_paths
HR-16: Career development paths between positions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)from_position_id→hr_positions(id)organization_id→pf_organizations(id)to_position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_career_paths_delete(DELETE)hr_career_paths_insert(INSERT)hr_career_paths_select(SELECT)hr_career_paths_update(UPDATE)
hr_case_documents
HR-14: Supporting documents for employee relations cases (storage: hr-employee-relations bucket)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)uploaded_by→pf_profiles(id)
hr_case_documents_delete(DELETE)hr_case_documents_insert(INSERT)hr_case_documents_select(SELECT)hr_case_documents_update(UPDATE)
hr_clinical_oversight_relationships
Links supervisors to supervisees for clinical oversight
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)requirement_id→hr_clinical_oversight_requirements(id)site_id→pf_sites(id)supervisee_id→hr_employees(id)supervisor_id→hr_employees(id)updated_by→users(id)
hr_oversight_relationships_delete(DELETE)hr_oversight_relationships_insert(INSERT)hr_oversight_relationships_select(SELECT)hr_oversight_relationships_update(UPDATE)
hr_clinical_oversight_requirements
Defines oversight frequency requirements by credential type
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)credential_type_id→hr_credential_types(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
hr_oversight_requirements_delete(DELETE)hr_oversight_requirements_insert(INSERT)hr_oversight_requirements_select(SELECT)hr_oversight_requirements_update(UPDATE)
hr_clinical_oversight_sessions
Individual clinical oversight session records
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)relationship_id→hr_clinical_oversight_relationships(id)site_id→pf_sites(id)supervisee_signature_id→pf_signatures(id)supervisor_signature_id→pf_signatures(id)updated_by→users(id)
hr_oversight_sessions_delete(DELETE)hr_oversight_sessions_insert(INSERT)hr_oversight_sessions_select(SELECT)hr_oversight_sessions_update(UPDATE)
hr_cobra_elections
RLS: ✅ enabled (4 policies)
Foreign keys:
cobra_event_id→hr_cobra_events(id)organization_id→pf_organizations(id)
hr_cobra_elections_delete(DELETE)hr_cobra_elections_insert(INSERT)hr_cobra_elections_select(SELECT)hr_cobra_elections_update(UPDATE)
hr_cobra_events
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_cobra_events_delete(DELETE)hr_cobra_events_insert(INSERT)hr_cobra_events_select(SELECT)hr_cobra_events_update(UPDATE)
hr_communication_templates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_communication_templates_delete(DELETE)hr_communication_templates_insert(INSERT)hr_communication_templates_select(SELECT)hr_communication_templates_update(UPDATE)
hr_compensation_analyses
Compensation analysis records for internal equity and market comparisons
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)department_id→pf_departments(id)organization_id→pf_organizations(id)position_id→hr_positions(id)reviewed_by→pf_profiles(id)updated_by→pf_profiles(id)
hr_compensation_analyses_delete(DELETE)hr_compensation_analyses_insert(INSERT)hr_compensation_analyses_select(SELECT)hr_compensation_analyses_update(UPDATE)
hr_competency_framework_skills
Skills within a competency framework
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)framework_id→hr_competency_frameworks(id)organization_id→pf_organizations(id)skill_id→hr_skills_library(id)updated_by→pf_profiles(id)
hr_competency_framework_skills_delete(DELETE)hr_competency_framework_skills_insert(INSERT)hr_competency_framework_skills_select(SELECT)hr_competency_framework_skills_update(UPDATE)
hr_competency_frameworks
Role-based competency models
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_competency_frameworks_delete(DELETE)hr_competency_frameworks_insert(INSERT)hr_competency_frameworks_select(SELECT)hr_competency_frameworks_update(UPDATE)
hr_contractor_classification_tests
HR-34: IRS worker classification assessment records
RLS: ✅ enabled (4 policies)
Foreign keys:
assessed_by→users(id)contractor_id→hr_contractors(id)created_by→users(id)organization_id→pf_organizations(id)reviewed_by→users(id)updated_by→users(id)
hr_contractor_classification_tests_delete(DELETE)hr_contractor_classification_tests_insert(INSERT)hr_contractor_classification_tests_select(SELECT)hr_contractor_classification_tests_update(UPDATE)
hr_contractor_contracts
HR-34: Contracts and agreements for contractors
RLS: ✅ enabled (4 policies)
Foreign keys:
contractor_id→hr_contractors(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_contractor_contracts_delete(DELETE)hr_contractor_contracts_insert(INSERT)hr_contractor_contracts_select(SELECT)hr_contractor_contracts_update(UPDATE)
hr_contractor_credentials
HR-34: Contractor license/certification records (parallel to hr_employee_credentials)
RLS: ✅ enabled (4 policies)
Foreign keys:
contractor_id→hr_contractors(id)created_by→users(id)credential_type_id→hr_credential_types(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_contractor_credentials_delete(DELETE)hr_contractor_credentials_insert(INSERT)hr_contractor_credentials_select(SELECT)hr_contractor_credentials_update(UPDATE)
hr_contractor_time_entries
HR-34: Contractor time/billing entries with approval workflow
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→users(id)contract_id→hr_contractor_contracts(id)contractor_id→hr_contractors(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_contractor_time_entries_delete(DELETE)hr_contractor_time_entries_insert(INSERT)hr_contractor_time_entries_select(SELECT)hr_contractor_time_entries_update(UPDATE)
hr_contractors
HR-34: Contractor and contingent workforce profiles
RLS: ✅ enabled (4 policies)
Foreign keys:
agency_id→hr_staffing_agencies(id)created_by→users(id)department_id→pf_departments(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_contractors_delete(DELETE)hr_contractors_insert(INSERT)hr_contractors_select(SELECT)hr_contractors_update(UPDATE)
hr_credential_alerts
HR-02: Logs expiration alerts sent to employees
RLS: ✅ enabled (2 policies)
Foreign keys:
employee_credential_id→hr_employee_credentials(id)notification_id→pf_notifications(id)organization_id→pf_organizations(id)
Users can view related credential alerts(SELECT)hr_credential_alerts_org_insert(INSERT)
hr_credential_renewal_workflows
RLS: ✅ enabled (4 policies)
Foreign keys:
approval_request_id→fw_approval_requests(id)cancelled_by→pf_profiles(id)created_by→pf_profiles(id)credential_id→hr_employee_credentials(id)employee_id→hr_employees(id)hr_approved_by→pf_profiles(id)manager_approved_by→pf_profiles(id)new_document_id→pf_documents(id)organization_id→pf_organizations(id)renewed_credential_id→hr_employee_credentials(id)updated_by→pf_profiles(id)
hr_credential_renewal_workflows_delete(DELETE)hr_credential_renewal_workflows_insert(INSERT)hr_credential_renewal_workflows_select(SELECT)hr_credential_renewal_workflows_update(UPDATE)
hr_credential_requirements
HR-02: Maps required credentials to positions or departments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credential_type_id→hr_credential_types(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
Users can view org credential requirements(SELECT)hr_credential_requirements_delete(DELETE)hr_credential_requirements_insert(INSERT)hr_credential_requirements_update(UPDATE)
hr_credential_types
HR-02: Defines types of credentials (licenses, certs, training, compliance docs)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
HR admins can delete credential types(DELETE)HR admins can insert credential types(INSERT)HR admins can update credential types(UPDATE)Users can view org credential types(SELECT)
hr_deduction_types
HR-PAY-02: Organization-defined payroll deduction categories (pre-tax, post-tax, garnishment, voluntary)
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)
hr_deduction_types_delete(DELETE)hr_deduction_types_insert(INSERT)hr_deduction_types_select(SELECT)hr_deduction_types_update(UPDATE)
hr_disciplinary_actions
HR-14: Disciplinary actions including warnings, suspensions, and terminations
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)incident_id→hr_incidents(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_disciplinary_actions_delete(DELETE)hr_disciplinary_actions_insert(INSERT)hr_disciplinary_actions_select(SELECT)hr_disciplinary_actions_update(UPDATE)
hr_document_access_logs
HR-12: Immutable audit log for document access (view/download) for compliance tracking
RLS: ✅ enabled (2 policies)
Foreign keys:
document_id→pf_documents(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_doc_access_logs_insert(INSERT)hr_doc_access_logs_select(SELECT)
hr_employee_bank_accounts
HR-PAY-03: Employee direct deposit bank accounts. Encryption handled by edge functions (hr-encrypt-bank-account, hr-decrypt-bank-account).
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)deactivated_by→users(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_employee_bank_accounts_delete(DELETE)hr_employee_bank_accounts_insert(INSERT)hr_employee_bank_accounts_select(SELECT)hr_employee_bank_accounts_update(UPDATE)
hr_employee_credentials
HR-02: Individual employee credentials with verification status and expiration tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credential_type_id→hr_credential_types(id)document_id→pf_documents(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)verified_by→pf_profiles(id)
Employees and HR can insert credentials(INSERT)HR admins and credential owners can update(UPDATE)HR admins can delete credentials(DELETE)Users can view accessible employee credentials(SELECT)
hr_employee_deductions
HR-PAY-02: Per-employee deduction assignments with effective dating and garnishment details
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)deduction_type_id→hr_deduction_types(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_employee_deductions_delete(DELETE)hr_employee_deductions_insert(INSERT)hr_employee_deductions_select(SELECT)hr_employee_deductions_update(UPDATE)
hr_employee_eeo_profiles
HR-42: voluntary workforce EEO demographics, isolated from general personnel records; seeded from candidate EEO on hire. Restricted to compliance/HR-admin via RLS.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_employee_eeo_profiles_delete(DELETE)hr_employee_eeo_profiles_insert(INSERT)hr_employee_eeo_profiles_select(SELECT)hr_employee_eeo_profiles_update(UPDATE)
hr_employee_leave_balances
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)policy_id→hr_leave_policies(id)updated_by→pf_profiles(id)
HR admins and system can update leave balances(UPDATE)HR admins can delete leave balances(DELETE)HR admins can insert leave balances(INSERT)Users can view accessible leave balances(SELECT)
hr_employee_preferences
Employee self-service portal preferences
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_employee_preferences_self_insert(INSERT)hr_employee_preferences_self_select(SELECT)hr_employee_preferences_self_update(UPDATE)
hr_employee_sites
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
Users can view employee sites(SELECT)hr_employee_sites_delete(DELETE)hr_employee_sites_insert(INSERT)hr_employee_sites_update(UPDATE)
hr_employee_skills
Employee skills inventory with verification tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
assessment_id→hr_skills_assessments(id)created_by→pf_profiles(id)credential_id→hr_employee_credentials(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)skill_id→hr_skills_library(id)updated_by→pf_profiles(id)verified_by→pf_profiles(id)
hr_employee_skills_delete(DELETE)hr_employee_skills_insert(INSERT)hr_employee_skills_select(SELECT)hr_employee_skills_update(UPDATE)
hr_employee_tax_info
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_employee_tax_info_insert(INSERT)hr_employee_tax_info_select(SELECT)hr_employee_tax_info_update(UPDATE)
hr_employee_teams
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)team_lead_id→hr_employees(id)updated_by→pf_profiles(id)
Users can view org teams(SELECT)hr_employee_teams_delete(DELETE)hr_employee_teams_insert(INSERT)hr_employee_teams_update(UPDATE)
hr_employee_transfers
HR-35: Executed employee position moves with optional HR-15 pay-change reference.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)from_position_id→hr_positions(id)internal_application_id→hr_internal_applications(id)organization_id→pf_organizations(id)pay_change_id→hr_merit_increases(id)to_position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_transfers_insert(INSERT)hr_transfers_select(SELECT)hr_transfers_update(UPDATE)
hr_employees
RLS: ✅ enabled (5 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)dotted_line_manager_id→hr_employees(id)employment_status_picklist_item_id→pf_picklist_items(id)level_id→pf_picklist_items(id)manager_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)primary_site_id→pf_sites(id)profile_id→pf_profiles(id)updated_by→pf_profiles(id)
Employees can update own limited fields(UPDATE)HR admins can delete employees(DELETE)HR admins can insert employees(INSERT)HR admins can update employees(UPDATE)Users can view active org employees(SELECT)
hr_employer_tax_config
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_employer_tax_config_delete(DELETE)hr_employer_tax_config_insert(INSERT)hr_employer_tax_config_select(SELECT)hr_employer_tax_config_update(UPDATE)
hr_engagement_action_plans
HR-17: Tracks improvement action plans based on engagement survey analytics
RLS: ✅ enabled (4 policies)
Foreign keys:
analytics_id→hr_engagement_analytics(id)assigned_to→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)survey_id→hr_engagement_surveys(id)target_department_id→pf_departments(id)updated_by→pf_profiles(id)
hr_engagement_action_plans_delete(DELETE)hr_engagement_action_plans_insert(INSERT)hr_engagement_action_plans_select(SELECT)hr_engagement_action_plans_update(UPDATE)
hr_engagement_analytics
HR-17: Aggregated engagement analytics and trends
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)survey_id→hr_engagement_surveys(id)updated_by→users(id)
hr_engagement_analytics_delete(DELETE)hr_engagement_analytics_insert(INSERT)hr_engagement_analytics_select(SELECT)hr_engagement_analytics_update(UPDATE)
hr_engagement_surveys
HR-17: Engagement survey definitions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)form_id→fw_forms(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_engagement_surveys_delete(DELETE)hr_engagement_surveys_insert(INSERT)hr_engagement_surveys_select(SELECT)hr_engagement_surveys_update(UPDATE)
hr_enrollment_reminder_logs
HR-11: Tracks enrollment reminder notifications sent to employees
RLS: ✅ enabled (2 policies)
Foreign keys:
employee_id→hr_employees(id)enrollment_period_id→hr_benefits_open_enrollment_periods(id)organization_id→pf_organizations(id)profile_id→pf_profiles(id)sent_by→users(id)
hr_enrollment_reminder_logs_insert(INSERT)hr_enrollment_reminder_logs_select(SELECT)
hr_entra_sync_log
Audit log for Entra ID synchronization operations (PF-63 Phase 3)
RLS: ✅ enabled (2 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_entra_sync_log_insert(INSERT)hr_entra_sync_log_select(SELECT)
hr_entra_sync_pending_changes
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)reviewed_by→users(id)updated_by→users(id)
hr_entra_sync_pending_org_delete(DELETE)hr_entra_sync_pending_org_insert(INSERT)hr_entra_sync_pending_org_select(SELECT)hr_entra_sync_pending_org_update(UPDATE)
hr_entra_unmatched_users
PF-63: Tracks Entra ID users discovered during directory sync that have no matching hr_employees record. Admins can link, create, or dismiss.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)linked_employee_id→hr_employees(id)organization_id→pf_organizations(id)resolved_by→pf_profiles(id)updated_by→pf_profiles(id)
hr_entra_unmatched_users_delete(DELETE)hr_entra_unmatched_users_insert(INSERT)hr_entra_unmatched_users_select(SELECT)hr_entra_unmatched_users_update(UPDATE)
hr_everify_audit_events
HR-26: Append-only E-Verify audit trail; no updates/deletes from app.
RLS: ✅ enabled (2 policies)
Foreign keys:
actor_id→pf_profiles(id)case_id→hr_everify_cases(id)organization_id→pf_organizations(id)
hr_everify_audit_insert(INSERT)hr_everify_audit_select(SELECT)
hr_everify_cases
HR-26: USCIS E-Verify case lifecycle per employee; PII-sensitive — RLS enforced.
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_everify_cases_insert(INSERT)hr_everify_cases_select(SELECT)hr_everify_cases_update(UPDATE)
hr_everify_config
HR-26: Per-organization E-Verify API endpoint, feature flags, and vault key reference (no plaintext secrets).
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_everify_config_insert(INSERT)hr_everify_config_select(SELECT)hr_everify_config_update(UPDATE)
hr_exit_interviews
HR-17: Exit interview records linked to HR-03 offboarding
RLS: ✅ enabled (4 policies)
Foreign keys:
conducted_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)form_submission_id→fw_form_submissions(id)offboarding_instance_id→hr_offboarding_instances(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_exit_interviews_delete(DELETE)hr_exit_interviews_insert(INSERT)hr_exit_interviews_select(SELECT)hr_exit_interviews_update(UPDATE)
hr_federal_tax_bracket_defaults
HR: Global federal payroll tax-bracket template (no organization_id). Copied per-org into hr_federal_tax_brackets by hr_backfill_federal_tax_brackets_for_org(). Source of truth for hr_backfill_federal_tax_brackets_for_all_orgs() and the new-org seed trigger.
RLS: ✅ enabled (4 policies)
Policies:
hr_federal_tax_bracket_defaults_delete(DELETE)hr_federal_tax_bracket_defaults_insert(INSERT)hr_federal_tax_bracket_defaults_select(SELECT)hr_federal_tax_bracket_defaults_update(UPDATE)
hr_federal_tax_brackets
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_federal_tax_brackets_delete(DELETE)hr_federal_tax_brackets_insert(INSERT)hr_federal_tax_brackets_select(SELECT)hr_federal_tax_brackets_update(UPDATE)
hr_fica_config
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_fica_config_delete(DELETE)hr_fica_config_insert(INSERT)hr_fica_config_select(SELECT)hr_fica_config_update(UPDATE)
hr_fingerprint_clearance_incidents
HR-28: Incidents (suspension, revocation, arrest, GCE) linked to fingerprint clearance records
RLS: ✅ enabled (4 policies)
Foreign keys:
clearance_id→hr_fingerprint_clearances(id)created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)resolved_by→users(id)updated_by→pf_profiles(id)
hr_fpc_incidents_delete(DELETE)hr_fpc_incidents_insert(INSERT)hr_fpc_incidents_select(SELECT)hr_fpc_incidents_update(UPDATE)
hr_fingerprint_clearances
HR-28: Arizona DPS fingerprint clearance cards per employee with status, expiration, and verification tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)verified_by→users(id)
hr_fingerprint_clearances_delete(DELETE)hr_fingerprint_clearances_insert(INSERT)hr_fingerprint_clearances_select(SELECT)hr_fingerprint_clearances_update(UPDATE)
hr_fmla_cases
RLS: ✅ enabled (4 policies)
Foreign keys:
certification_document_id→pf_documents(id)created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
HR admins can delete FMLA cases(DELETE)HR admins can insert FMLA cases(INSERT)HR admins can update FMLA cases(UPDATE)HR admins can view FMLA cases(SELECT)
hr_grievance_assignees
HR-14: HR staff assigned to handle a grievance (multiple assignees per case)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)grievance_id→hr_grievances(id)organization_id→pf_organizations(id)profile_id→pf_profiles(id)
hr_grievance_assignees_delete(DELETE)hr_grievance_assignees_insert(INSERT)hr_grievance_assignees_select(SELECT)hr_grievance_assignees_update(UPDATE)
hr_grievances
HR-14: Employee grievances and formal complaints
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)investigation_id→hr_investigations(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_grievances_delete(DELETE)hr_grievances_insert(INSERT)hr_grievances_select(SELECT)hr_grievances_update(UPDATE)
hr_handbook_bundle_items
HR-43: Ordered policy items inside a handbook bundle. policy_id references gr_policies(id) without FK (cross-core).
RLS: ✅ enabled (4 policies)
Foreign keys:
bundle_id→hr_handbook_bundles(id)created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_handbook_bundle_items_delete(DELETE)hr_handbook_bundle_items_insert(INSERT)hr_handbook_bundle_items_select(SELECT)hr_handbook_bundle_items_update(UPDATE)
hr_handbook_bundles
HR-43: New-hire / required-reading bundle of GR policies.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)onboarding_template_id→hr_onboarding_templates(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_handbook_bundles_delete(DELETE)hr_handbook_bundles_insert(INSERT)hr_handbook_bundles_select(SELECT)hr_handbook_bundles_update(UPDATE)
hr_hire_transitions
HR-09: Audit trail for candidate to employee transitions
RLS: ✅ enabled (3 policies)
Foreign keys:
application_id→hr_applications(id)candidate_id→hr_candidates(id)created_by→pf_profiles(id)employee_id→hr_employees(id)offer_id→hr_offers(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_hire_transitions_delete(DELETE)hr_hire_transitions_insert(INSERT)hr_hire_transitions_select(SELECT)
hr_holidays
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_holidays_delete(DELETE)hr_holidays_insert(INSERT)hr_holidays_select(SELECT)hr_holidays_update(UPDATE)
hr_incidents
HR-14: Workplace incidents, accidents, and safety events
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)reported_by→pf_profiles(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_incidents_delete(DELETE)hr_incidents_insert(INSERT)hr_incidents_select(SELECT)hr_incidents_update(UPDATE)
hr_internal_application_stage_audit
RLS: ✅ enabled (2 policies)
Foreign keys:
application_id→hr_internal_applications(id)changed_by→pf_profiles(id)organization_id→pf_organizations(id)
hr_app_audit_insert(INSERT)hr_app_audit_select(SELECT)
hr_internal_applications
HR-35: Employee internal job applications (separate from HR-09 external ATS).
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)current_manager_id→hr_employees(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_internal_apps_insert(INSERT)hr_internal_apps_select(SELECT)hr_internal_apps_update(UPDATE)
hr_interview_feedback
HR-09: Structured interviewer feedback
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)interview_id→hr_interviews(id)interviewer_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_interview_feedback_delete(DELETE)hr_interview_feedback_insert(INSERT)hr_interview_feedback_select(SELECT)hr_interview_feedback_update(UPDATE)
hr_interview_scorecard_templates
HR-09-EN1: Reusable templates defining competencies and rating scales for structured interview scorecards.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_scorecard_templates_delete(DELETE)hr_scorecard_templates_insert(INSERT)hr_scorecard_templates_select(SELECT)hr_scorecard_templates_update(UPDATE)
hr_interview_scorecards
HR-09-EN1: Per-interviewer scorecard submissions for interviews. Supports blind evaluation via RLS.
RLS: ✅ enabled (3 policies)
Foreign keys:
application_id→hr_applications(id)created_by→users(id)interview_id→hr_interviews(id)interviewer_id→users(id)job_posting_id→hr_job_postings(id)organization_id→pf_organizations(id)template_id, organization_id→hr_interview_scorecard_templates(id, organization_id)updated_by→users(id)
hr_scorecards_insert(INSERT)hr_scorecards_select(SELECT)hr_scorecards_update(UPDATE)
hr_interviews
HR-09: Interview scheduling and tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
application_id→hr_applications(id)created_by→pf_profiles(id)interviewer_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_interviews_delete(DELETE)hr_interviews_insert(INSERT)hr_interviews_select(SELECT)hr_interviews_update(UPDATE)
hr_investigations
HR-14: Investigation case management for incidents, grievances, and disciplinary matters
RLS: ✅ enabled (4 policies)
Foreign keys:
source_disciplinary_id→hr_disciplinary_actions(id)source_grievance_id→hr_grievances(id)source_incident_id→hr_incidents(id)assigned_to→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_investigations_delete(DELETE)hr_investigations_insert(INSERT)hr_investigations_select(SELECT)hr_investigations_update(UPDATE)
hr_job_board_import_checkpoints
HR-09-P5.4: Cursor-based import checkpoints for resumable application imports
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)integration_id→hr_job_board_integrations(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_job_board_import_checkpoints_delete(DELETE)hr_job_board_import_checkpoints_insert(INSERT)hr_job_board_import_checkpoints_select(SELECT)hr_job_board_import_checkpoints_update(UPDATE)
hr_job_board_integrations
HR-09: Job board integration configurations for automated posting
RLS: ✅ enabled (4 policies)
Foreign keys:
api_key_vault_id→pf_credential_vault(id)api_secret_vault_id→pf_credential_vault(id)created_by→pf_profiles(id)credential_id→pf_credentials(id)oauth_access_token_vault_id→pf_credential_vault(id)oauth_client_id_vault_id→pf_credential_vault(id)oauth_client_secret_vault_id→pf_credential_vault(id)oauth_refresh_token_vault_id→pf_credential_vault(id)organization_id→pf_organizations(id)refresh_token_vault_id→pf_credential_vault(id)updated_by→pf_profiles(id)
hr_job_board_integrations_delete(DELETE)hr_job_board_integrations_insert(INSERT)hr_job_board_integrations_select(SELECT)hr_job_board_integrations_update(UPDATE)
hr_job_board_postings
HR-09: Individual job postings tracked per job board
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)integration_id→hr_job_board_integrations(id)job_posting_id→hr_job_postings(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_job_board_postings_delete(DELETE)hr_job_board_postings_insert(INSERT)hr_job_board_postings_select(SELECT)hr_job_board_postings_update(UPDATE)
hr_job_board_webhook_events
HR-09-P5.4: Webhook idempotency ledger — prevents duplicate processing of provider callbacks
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_job_board_integrations(id)organization_id→pf_organizations(id)
hr_job_board_webhook_events_delete(DELETE)hr_job_board_webhook_events_insert(INSERT)hr_job_board_webhook_events_select(SELECT)hr_job_board_webhook_events_update(UPDATE)
hr_job_description_agreements
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)generated_document_id→pf_documents(id)manager_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_job_description_agreements_delete(DELETE)hr_job_description_agreements_insert(INSERT)hr_job_description_agreements_select(SELECT)hr_job_description_agreements_update(UPDATE)
hr_job_postings
HR-09: Job posting records for ATS
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)default_scorecard_template_id→hr_interview_scorecard_templates(id)department_id→pf_departments(id)hiring_manager_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_job_postings_delete(DELETE)hr_job_postings_insert(INSERT)hr_job_postings_select(SELECT)hr_job_postings_update(UPDATE)
hr_leadership_program_definitions
HR-16: Organization catalog of leadership development programs
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_leadership_program_definitions_delete(DELETE)hr_leadership_program_definitions_insert(INSERT)hr_leadership_program_definitions_select(SELECT)hr_leadership_program_definitions_update(UPDATE)
hr_leadership_programs
HR-16: Leadership program enrollment and tracking
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)program_definition_id→hr_leadership_program_definitions(id)sponsor_employee_id→hr_employees(id)updated_by→pf_profiles(id)
hr_leadership_programs_delete(DELETE)hr_leadership_programs_insert(INSERT)hr_leadership_programs_select(SELECT)hr_leadership_programs_update(UPDATE)
hr_leave_accrual_tiers
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)policy_id→hr_leave_policies(id)updated_by→pf_profiles(id)
hr_leave_accrual_tiers_delete(DELETE)hr_leave_accrual_tiers_insert(INSERT)hr_leave_accrual_tiers_select(SELECT)hr_leave_accrual_tiers_update(UPDATE)
hr_leave_policies
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
HR admins can delete leave policies(DELETE)HR admins can insert leave policies(INSERT)HR admins can update leave policies(UPDATE)Users can view org leave policies(SELECT)
hr_leave_requests
RLS: ✅ enabled (5 policies)
Foreign keys:
cancelled_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)fmla_case_id→hr_fmla_cases(id)organization_id→pf_organizations(id)policy_id→hr_leave_policies(id)reviewed_by→pf_profiles(id)updated_by→pf_profiles(id)
Employees can cancel own pending requests(UPDATE)Employees can create own leave requests(INSERT)Managers and HR can approve/deny requests(UPDATE)Users can view accessible leave requests(SELECT)hr_leave_requests_admin_delete(DELETE)
hr_merit_increases
Merit increase records tied to performance reviews
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)review_id→hr_performance_reviews(id)updated_by→pf_profiles(id)
hr_merit_increases_delete(DELETE)hr_merit_increases_insert(INSERT)hr_merit_increases_select(SELECT)hr_merit_increases_update(UPDATE)
hr_module_settings
RLS: ✅ enabled (4 policies)
Foreign keys:
bgc_default_provider_id→hr_background_check_providers(id)created_by→pf_profiles(id)default_onboarding_template_id→hr_onboarding_templates(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_module_settings_delete(DELETE)hr_module_settings_insert(INSERT)hr_module_settings_update(UPDATE)users_view_org_settings(SELECT)
hr_offboarding_checklist_items
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)completed_by→pf_profiles(id)offboarding_instance_id→hr_offboarding_instances(id)organization_id→pf_organizations(id)
Assigned users and HR admins can update checklist items(UPDATE)Users can view accessible offboarding checklist items(SELECT)hr_offboarding_checklist_items_delete(DELETE)hr_offboarding_checklist_items_insert(INSERT)
hr_offboarding_instances
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→users(id)
Users can view accessible offboarding instances(SELECT)hr_offboarding_instances_delete(DELETE)hr_offboarding_instances_insert(INSERT)hr_offboarding_instances_update(UPDATE)
hr_offer_approvals
RLS: ✅ enabled (4 policies)
Foreign keys:
approver_id→pf_profiles(id)offer_id→hr_offers(id)organization_id→pf_organizations(id)
hr_offer_approvals_delete(DELETE)hr_offer_approvals_insert(INSERT)hr_offer_approvals_select(SELECT)hr_offer_approvals_update(UPDATE)
hr_offer_counteroffers
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)offer_id→hr_offers(id)organization_id→pf_organizations(id)responded_by→pf_profiles(id)
hr_offer_counteroffers_delete(DELETE)hr_offer_counteroffers_insert(INSERT)hr_offer_counteroffers_select(SELECT)hr_offer_counteroffers_update(UPDATE)
hr_offer_templates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_offer_templates_delete(DELETE)hr_offer_templates_insert(INSERT)hr_offer_templates_select(SELECT)hr_offer_templates_update(UPDATE)
hr_offers
HR-09: Job offers with approval workflow
RLS: ✅ enabled (4 policies)
Foreign keys:
application_id→hr_applications(id)approved_by→pf_profiles(id)candidate_id→hr_candidates(id)created_by→pf_profiles(id)department_id→pf_departments(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)sent_by→pf_profiles(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_offers_delete(DELETE)hr_offers_insert(INSERT)hr_offers_select(SELECT)hr_offers_update(UPDATE)
hr_onboarding_instances
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)template_id→hr_onboarding_templates(id)updated_by→users(id)
HR admins can create onboarding instances(INSERT)HR admins can delete onboarding instances(DELETE)HR admins can update onboarding instances(UPDATE)Users can view accessible onboarding instances(SELECT)
hr_onboarding_task_instances
RLS: ✅ enabled (4 policies)
Foreign keys:
assigned_to→pf_profiles(id)completed_by→pf_profiles(id)credential_id→hr_employee_credentials(id)document_id→pf_documents(id)form_submission_id→fw_form_submissions(id)onboarding_instance_id→hr_onboarding_instances(id)organization_id→pf_organizations(id)task_id→hr_onboarding_tasks(id)
Assigned users can update their tasks(UPDATE)Users can view accessible task instances(SELECT)hr_onboarding_task_instances_delete(DELETE)hr_onboarding_task_instances_insert(INSERT)
hr_onboarding_tasks
RLS: ✅ enabled (4 policies)
Foreign keys:
credential_type_id→hr_credential_types(id)form_id→fw_forms(id)organization_id→pf_organizations(id)template_id→hr_onboarding_templates(id)
Users can view template tasks(SELECT)hr_onboarding_tasks_delete(DELETE)hr_onboarding_tasks_insert(INSERT)hr_onboarding_tasks_update(UPDATE)
hr_onboarding_tasks_audit
Audit trail for onboarding tasks removed by corrective migrations.
RLS: ✅ enabled (4 policies)
Policies:
hr_onboarding_tasks_audit_delete_disabled(DELETE)hr_onboarding_tasks_audit_insert(INSERT)hr_onboarding_tasks_audit_select(SELECT)hr_onboarding_tasks_audit_update_disabled(UPDATE)
hr_onboarding_templates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
Users can view org templates(SELECT)hr_onboarding_templates_delete(DELETE)hr_onboarding_templates_insert(INSERT)hr_onboarding_templates_update(UPDATE)
hr_pay_adjustments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)processed_by→pf_profiles(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_pay_adjustments_delete(DELETE)hr_pay_adjustments_insert(INSERT)hr_pay_adjustments_select(SELECT)hr_pay_adjustments_update(UPDATE)
hr_pay_calendar_events
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)pay_schedule_id→hr_pay_schedules(id)payroll_run_id→hr_payroll_runs(id)updated_by→pf_profiles(id)
hr_pay_calendar_events_delete(DELETE)hr_pay_calendar_events_insert(INSERT)hr_pay_calendar_events_select(SELECT)hr_pay_calendar_events_update(UPDATE)
hr_pay_rates
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_pay_rates_delete(DELETE)hr_pay_rates_insert(INSERT)hr_pay_rates_select(SELECT)hr_pay_rates_update(UPDATE)
hr_pay_schedules
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_pay_schedules_delete(DELETE)hr_pay_schedules_insert(INSERT)hr_pay_schedules_select(SELECT)hr_pay_schedules_update(UPDATE)
hr_pay_stubs
HR-PAY-03: Employee pay stubs for self-service portal
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)payroll_line_item_id→hr_payroll_line_items(id)payroll_run_id→hr_payroll_runs(id)updated_by→users(id)
hr_pay_stubs_delete(DELETE)hr_pay_stubs_insert(INSERT)hr_pay_stubs_select(SELECT)hr_pay_stubs_update(UPDATE)
hr_payment_batches
HR-PAY-03: Payment batches for direct deposit processing
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payroll_run_id→hr_payroll_runs(id)submitted_by→users(id)updated_by→users(id)
hr_payment_batches_delete(DELETE)hr_payment_batches_insert(INSERT)hr_payment_batches_select(SELECT)hr_payment_batches_update(UPDATE)
hr_payment_checks
HR-PAY-03 Phase 2: Physical check records linked to payment items
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)payment_batch_id→hr_payment_batches(id)payment_item_id→hr_payment_items(id)updated_by→users(id)
hr_payment_checks_delete(DELETE)hr_payment_checks_insert(INSERT)hr_payment_checks_select(SELECT)hr_payment_checks_update(UPDATE)
hr_payment_items
HR-PAY-03: Individual payment items within a batch
RLS: ✅ enabled (4 policies)
Foreign keys:
bank_account_id→hr_employee_bank_accounts(id)created_by→users(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)payment_batch_id→hr_payment_batches(id)updated_by→users(id)
hr_payment_items_delete(DELETE)hr_payment_items_insert(INSERT)hr_payment_items_select(SELECT)hr_payment_items_update(UPDATE)
hr_payroll_audit_log
Audit log for payroll actions - HR-07 Phase 5
RLS: ✅ enabled (2 policies)
Foreign keys:
employee_id→hr_employees(id)organization_id→pf_organizations(id)payroll_run_id→hr_payroll_runs(id)performed_by→pf_profiles(id)
hr_payroll_audit_log_insert(INSERT)hr_payroll_audit_log_select(SELECT)
hr_payroll_deduction_items
HR-PAY-02: Append-only per-payroll-run deduction line items for audit trail
RLS: ✅ enabled (2 policies)
Foreign keys:
employee_deduction_id→hr_employee_deductions(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)payroll_line_item_id→hr_payroll_line_items(id)payroll_run_id→hr_payroll_runs(id)
hr_payroll_deduction_items_insert(INSERT)hr_payroll_deduction_items_select(SELECT)
hr_payroll_exports
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)payroll_run_id→hr_payroll_runs(id)updated_by→users(id)
hr_payroll_exports_delete(DELETE)hr_payroll_exports_insert(INSERT)hr_payroll_exports_select(SELECT)hr_payroll_exports_update(UPDATE)
hr_payroll_line_items
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)payroll_run_id→hr_payroll_runs(id)timesheet_id→hr_timesheets(id)updated_by→pf_profiles(id)
hr_payroll_line_items_delete(DELETE)hr_payroll_line_items_insert(INSERT)hr_payroll_line_items_select(SELECT)hr_payroll_line_items_update(UPDATE)
hr_payroll_runs
RLS: ✅ enabled (3 policies)
Foreign keys:
created_by→pf_profiles(id)exported_by→pf_profiles(id)finalized_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_payroll_runs_insert(INSERT)hr_payroll_runs_select(SELECT)hr_payroll_runs_update(UPDATE)
hr_performance_competencies
Competency assessments within performance reviews
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)credential_type_id→hr_credential_types(id)organization_id→pf_organizations(id)review_id→hr_performance_reviews(id)updated_by→pf_profiles(id)
hr_performance_competencies_delete(DELETE)hr_performance_competencies_insert(INSERT)hr_performance_competencies_select(SELECT)hr_performance_competencies_update(UPDATE)
hr_performance_cycles
Performance review cycles for scheduling and managing reviews
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_performance_cycles_delete(DELETE)hr_performance_cycles_insert(INSERT)hr_performance_cycles_select(SELECT)hr_performance_cycles_update(UPDATE)
hr_performance_feedback
360 feedback from peers, managers, direct reports
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)feedback_source_id→pf_profiles(id)organization_id→pf_organizations(id)requested_by→pf_profiles(id)review_id→hr_performance_reviews(id)updated_by→pf_profiles(id)
hr_performance_feedback_delete(DELETE)hr_performance_feedback_insert(INSERT)hr_performance_feedback_select(SELECT)hr_performance_feedback_update(UPDATE)
hr_performance_goals
Individual performance goals linked to reviews
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)review_id→hr_performance_reviews(id)updated_by→pf_profiles(id)
hr_performance_goals_delete(DELETE)hr_performance_goals_insert(INSERT)hr_performance_goals_select(SELECT)hr_performance_goals_update(UPDATE)
hr_performance_improvement_plans
Performance improvement plans for underperforming employees
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)owner_id→pf_profiles(id)review_id→hr_performance_reviews(id)updated_by→pf_profiles(id)
hr_pip_delete(DELETE)hr_pip_insert(INSERT)hr_pip_select(SELECT)hr_pip_update(UPDATE)
hr_performance_reviews
Individual performance reviews for employees
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)cycle_id→hr_performance_cycles(id)employee_acknowledged_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)reviewer_id→pf_profiles(id)updated_by→pf_profiles(id)
hr_performance_reviews_delete(DELETE)hr_performance_reviews_insert(INSERT)hr_performance_reviews_select(SELECT)hr_performance_reviews_update(UPDATE)
hr_position_assignments
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_position_assignments_delete(DELETE)hr_position_assignments_insert(INSERT)hr_position_assignments_select(SELECT)hr_position_assignments_update(UPDATE)
hr_position_eeo_mappings
HR-42: maps a position to one of 10 federal EEOC Component 1 job categories (validated app-side per CONTEXT.md D5a). Used in EEO-1 aggregation.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_position_eeo_mappings_delete(DELETE)hr_position_eeo_mappings_insert(INSERT)hr_position_eeo_mappings_select(SELECT)hr_position_eeo_mappings_update(UPDATE)
hr_position_history
RLS: ✅ enabled (2 policies)
Foreign keys:
changed_by→pf_profiles(id)corrects_history_id→hr_position_history(id)organization_id→pf_organizations(id)position_id→hr_positions(id)
hr_position_history_insert(INSERT)hr_position_history_select(SELECT)
hr_position_skill_requirements
Required skills for each position
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)position_id→hr_positions(id)skill_id→hr_skills_library(id)source_framework_id→hr_competency_frameworks(id)updated_by→pf_profiles(id)
hr_position_skill_requirements_delete(DELETE)hr_position_skill_requirements_insert(INSERT)hr_position_skill_requirements_select(SELECT)hr_position_skill_requirements_update(UPDATE)
hr_positions
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)reporting_to_position_id→hr_positions(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
HR admins can delete positions(DELETE)HR admins can insert positions(INSERT)HR admins can update positions(UPDATE)Users can view org positions(SELECT)
hr_proliant_accrual_balances
HR-44 OQ-6: Read-only mirror of Proliant accrual balances.
RLS: ✅ enabled (3 policies)
Foreign keys:
employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_proliant_accrual_insert(INSERT)hr_proliant_accrual_select(SELECT)hr_proliant_accrual_update(UPDATE)
hr_proliant_code_mappings
HR-44 Stage 2: Proliant code → Encore value mapping (earnings, deductions, jobs, shifts, cost centers, taxes, pay frequency/group).
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_codemap_delete(DELETE)hr_proliant_codemap_insert(INSERT)hr_proliant_codemap_select(SELECT)hr_proliant_codemap_update(UPDATE)
hr_proliant_company_mappings
HR-44: Multi-EIN Proliant company → org mapping.
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_company_delete(DELETE)hr_proliant_company_insert(INSERT)hr_proliant_company_select(SELECT)hr_proliant_company_update(UPDATE)
hr_proliant_employee_mappings
HR-44: Proliant ↔ Encore employee mapping. match_hash is HMAC-SHA256(ssn, org_key); never store raw SSN.
RLS: ✅ enabled (4 policies)
Foreign keys:
employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_proliant_emp_delete(DELETE)hr_proliant_emp_insert(INSERT)hr_proliant_emp_select(SELECT)hr_proliant_emp_update(UPDATE)
hr_proliant_field_mappings
HR-44: Per-org Proliant→Encore field mapping overrides.
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_fmap_delete(DELETE)hr_proliant_fmap_insert(INSERT)hr_proliant_fmap_select(SELECT)hr_proliant_fmap_update(UPDATE)
hr_proliant_integrations
HR-44: One Proliant HCM integration config per org. Credentials via pf_credential_vault.
RLS: ✅ enabled (4 policies)
Foreign keys:
client_id_credential_id→pf_credential_vault(id)client_secret_credential_id→pf_credential_vault(id)organization_id→pf_organizations(id)ssn_hmac_key_credential_id→pf_credential_vault(id)
hr_proliant_integrations_delete(DELETE)hr_proliant_integrations_insert(INSERT)hr_proliant_integrations_select(SELECT)hr_proliant_integrations_update(UPDATE)
hr_proliant_payroll_calendars
HR-44 Stage 2: Proliant payroll calendar periods (one row per pay period per company).
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_cal_delete(DELETE)hr_proliant_cal_insert(INSERT)hr_proliant_cal_select(SELECT)hr_proliant_cal_update(UPDATE)
hr_proliant_payroll_details
HR-44: Normalized payroll line items.
RLS: ✅ enabled (2 policies)
Foreign keys:
organization_id→pf_organizations(id)payroll_run_id→hr_proliant_payroll_runs(id)
hr_proliant_paydet_insert(INSERT)hr_proliant_paydet_select(SELECT)
hr_proliant_payroll_runs
HR-44: Payroll run summaries from Proliant (one row per employee per run).
RLS: ✅ enabled (3 policies)
Foreign keys:
employee_id→hr_employees(id)organization_id→pf_organizations(id)
hr_proliant_payrun_insert(INSERT)hr_proliant_payrun_select(SELECT)hr_proliant_payrun_update(UPDATE)
hr_proliant_push_log
HR-44-EN-01: applied push idempotency keys; a re-run with an already-applied key is skipped so pushes are not double-applied to Proliant.
RLS: ✅ enabled (3 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_push_log_insert(INSERT)hr_proliant_push_log_select(SELECT)hr_proliant_push_log_update(UPDATE)
hr_proliant_reconciliation
HR-44 Stage 2: Pre-submit reconciliation of expected vs returned payroll totals, with variance override audit.
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)run_state_id→hr_proliant_run_state(id)
hr_proliant_recon_delete(DELETE)hr_proliant_recon_insert(INSERT)hr_proliant_recon_select(SELECT)hr_proliant_recon_update(UPDATE)
hr_proliant_run_state
HR-44 Stage 2: Embedded payroll run state machine (one row per org per calendar period).
RLS: ✅ enabled (4 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_runstate_delete(DELETE)hr_proliant_runstate_insert(INSERT)hr_proliant_runstate_select(SELECT)hr_proliant_runstate_update(UPDATE)
hr_proliant_sync_log
HR-44: Immutable audit log (append-only; no UPDATE/DELETE policies). proliant_raw is PII-stripped.
RLS: ✅ enabled (2 policies)
Foreign keys:
employee_id→hr_employees(id)organization_id→pf_organizations(id)sync_run_id→hr_proliant_sync_runs(id)
hr_proliant_log_insert(INSERT)hr_proliant_log_select(SELECT)
hr_proliant_sync_runs
HR-44: Per-execution sync record. checkpoint JSONB enables resume after edge function timeout.
RLS: ✅ enabled (3 policies)
Foreign keys:
integration_id→hr_proliant_integrations(id)organization_id→pf_organizations(id)
hr_proliant_runs_insert(INSERT)hr_proliant_runs_select(SELECT)hr_proliant_runs_update(UPDATE)
hr_reference_emails
Audit log of emails sent for reference requests
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)reference_id→hr_references(id)
hr_reference_emails_delete(DELETE)hr_reference_emails_insert(INSERT)hr_reference_emails_select(SELECT)hr_reference_emails_update(UPDATE)
hr_references
Reference check requests and responses for candidates
RLS: ✅ enabled (4 policies)
Foreign keys:
application_id→hr_applications(id)candidate_id→hr_candidates(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)verified_by→pf_profiles(id)
hr_references_delete(DELETE)hr_references_insert(INSERT)hr_references_select(SELECT)hr_references_update(UPDATE)
hr_report_audit_events
HR-42: append-only audit log of sensitive HR report exports (EEO-1, benefits census, etc.). Metadata only — never row-level PHI. INSERT only via hr_log_report_audit_event(); no UPDATE/DELETE.
RLS: ✅ enabled (1 policies)
Foreign keys:
actor_user_id→pf_profiles(id)organization_id→pf_organizations(id)
hr_report_audit_events_select(SELECT)
hr_salary_bands
Salary band definitions for positions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_salary_bands_delete(DELETE)hr_salary_bands_insert(INSERT)hr_salary_bands_select(SELECT)hr_salary_bands_update(UPDATE)
hr_sharepoint_memberships
Tracks SharePoint group memberships for employees (PF-63 Phase 3.2)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_sharepoint_memberships_delete(DELETE)hr_sharepoint_memberships_insert(INSERT)hr_sharepoint_memberships_select(SELECT)hr_sharepoint_memberships_update(UPDATE)
hr_shift_assignments
HR-04: Employee assignments to shifts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)shift_id→hr_shifts(id)updated_by→pf_profiles(id)
HR admins and assigned employees can update assignments(UPDATE)HR admins and employees can insert assignments(INSERT)HR admins can delete assignments(DELETE)Users can view org shift assignments(SELECT)
hr_shift_swap_requests
HR-04: Shift swap workflow between employees
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)assignment_id→hr_shift_assignments(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)requesting_employee_id→hr_employees(id)target_employee_id→hr_employees(id)updated_by→pf_profiles(id)
Employees can create swap requests(INSERT)HR admins and managers can update swap requests(UPDATE)HR admins can delete swap requests(DELETE)Users can view related swap requests(SELECT)
hr_shift_templates
HR-04: Reusable shift patterns for scheduling
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)required_position_id→hr_positions(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
HR admins can delete shift templates(DELETE)HR admins can insert shift templates(INSERT)HR admins can update shift templates(UPDATE)Users can view org shift templates(SELECT)
hr_shifts
HR-04: Individual shift instances on specific dates
RLS: ✅ enabled (4 policies)
Foreign keys:
calculated_by_driver_id→hr_workload_drivers(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)required_position_id→hr_positions(id)site_id→pf_sites(id)template_id→hr_shift_templates(id)updated_by→pf_profiles(id)
HR admins can delete shifts(DELETE)HR admins can insert shifts(INSERT)HR admins can update shifts(UPDATE)Users can view org shifts(SELECT)
hr_site_geofence
HR-05-EN03: Geofence configuration per site for time punch location validation
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
hr_site_geofence_delete(DELETE)hr_site_geofence_insert(INSERT)hr_site_geofence_select(SELECT)hr_site_geofence_update(UPDATE)
hr_skills_assessments
Skills validation and assessment records
RLS: ✅ enabled (3 policies)
Foreign keys:
assessed_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)skill_id→hr_skills_library(id)updated_by→pf_profiles(id)
hr_skills_assessments_insert(INSERT)hr_skills_assessments_select(SELECT)hr_skills_assessments_update(UPDATE)
hr_skills_library
Centralized skills catalog for the organization
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)parent_skill_id→hr_skills_library(id)updated_by→pf_profiles(id)
hr_skills_library_delete(DELETE)hr_skills_library_insert(INSERT)hr_skills_library_select(SELECT)hr_skills_library_update(UPDATE)
hr_sms_consent_logs
TCPA compliance: Tracks explicit SMS consent for background check notifications (HR-09-P5 Phase 5.2c)
RLS: ✅ enabled (4 policies)
Foreign keys:
application_id→hr_applications(id)background_check_id→hr_background_checks(id)candidate_id→hr_candidates(id)captured_by→users(id)created_by→users(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
hr_sms_consent_logs_delete(DELETE)hr_sms_consent_logs_insert(INSERT)hr_sms_consent_logs_select(SELECT)hr_sms_consent_logs_update(UPDATE)
hr_ssn_access_log
RLS: ✅ enabled (2 policies)
Foreign keys:
accessed_by→pf_profiles(id)dependent_id→hr_benefits_dependents(id)organization_id→pf_organizations(id)
hr_ssn_access_log_insert(INSERT)hr_ssn_access_log_select(SELECT)
hr_staffing_agencies
HR-34: Staffing agencies providing contract/temp workforce
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)updated_by→users(id)
hr_staffing_agencies_delete(DELETE)hr_staffing_agencies_insert(INSERT)hr_staffing_agencies_select(SELECT)hr_staffing_agencies_update(UPDATE)
hr_succession_plans
HR-16: Tracks succession planning for key positions with readiness scores
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)incumbent_employee_id→hr_employees(id)organization_id→pf_organizations(id)position_id→hr_positions(id)reviewed_by→pf_profiles(id)successor_employee_id→hr_employees(id)updated_by→pf_profiles(id)
hr_succession_plans_delete(DELETE)hr_succession_plans_insert(INSERT)hr_succession_plans_select(SELECT)hr_succession_plans_update(UPDATE)
hr_survey_responses
HR-17: Employee survey responses
RLS: ✅ enabled (4 policies)
Foreign keys:
employee_id→hr_employees(id)form_submission_id→fw_form_submissions(id)organization_id→pf_organizations(id)survey_id→hr_engagement_surveys(id)
hr_survey_responses_delete(DELETE)hr_survey_responses_insert(INSERT)hr_survey_responses_select(SELECT)hr_survey_responses_update(UPDATE)
hr_talent_pipelines
HR-16: High-potential employee talent pipeline entries
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)mentor_employee_id→hr_employees(id)organization_id→pf_organizations(id)reviewed_by→pf_profiles(id)target_position_id→hr_positions(id)updated_by→pf_profiles(id)
hr_talent_pipelines_delete(DELETE)hr_talent_pipelines_insert(INSERT)hr_talent_pipelines_select(SELECT)hr_talent_pipelines_update(UPDATE)
hr_tax_documents
Tax documents (W-2, 1099, 1095-C) for employees
RLS: ✅ enabled (6 policies)
Foreign keys:
correction_of→hr_tax_documents(id)created_by→pf_profiles(id)document_id→pf_documents(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_tax_documents_admin_delete(DELETE)hr_tax_documents_admin_insert(INSERT)hr_tax_documents_admin_select(SELECT)hr_tax_documents_admin_update(UPDATE)hr_tax_documents_self_select(SELECT)hr_tax_documents_self_update_status(UPDATE)
hr_tax_form_items
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)original_form_item_id→hr_tax_form_items(id)tax_document_id→hr_tax_documents(id)tax_form_run_id→hr_tax_form_runs(id)updated_by→pf_profiles(id)
hr_tax_form_items_delete(DELETE)hr_tax_form_items_insert(INSERT)hr_tax_form_items_select(SELECT)hr_tax_form_items_update(UPDATE)
hr_tax_form_runs
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)filed_by→pf_profiles(id)finalized_by→pf_profiles(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_tax_form_runs_delete(DELETE)hr_tax_form_runs_insert(INSERT)hr_tax_form_runs_select(SELECT)hr_tax_form_runs_update(UPDATE)
hr_tax_form_state_items
HR-PAY-04: Per-state W-2 wage/tax breakdown for multi-state employees.
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→users(id)organization_id→pf_organizations(id)tax_form_item_id→hr_tax_form_items(id)updated_by→users(id)
hr_tax_form_state_items_delete(DELETE)hr_tax_form_state_items_insert(INSERT)hr_tax_form_state_items_select(SELECT)hr_tax_form_state_items_update(UPDATE)
hr_team_members
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)team_id→hr_employee_teams(id)
Users can view team members(SELECT)hr_team_members_delete(DELETE)hr_team_members_insert(INSERT)hr_team_members_update(UPDATE)
hr_teams_memberships
Tracks Microsoft Teams memberships for employees (PF-63 Phase 3.1)
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)department_id→pf_departments(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_teams_memberships_delete(DELETE)hr_teams_memberships_insert(INSERT)hr_teams_memberships_select(SELECT)hr_teams_memberships_update(UPDATE)
hr_time_exceptions
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)resolved_by→pf_profiles(id)timesheet_entry_id→hr_timesheet_entries(id)updated_by→pf_profiles(id)
hr_time_exceptions_delete(DELETE)hr_time_exceptions_insert(INSERT)hr_time_exceptions_select(SELECT)hr_time_exceptions_update(UPDATE)
hr_time_punches
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)edited_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)shift_assignment_id→hr_shift_assignments(id)
Employees can create own punches(INSERT)Employees can view own punches(SELECT)HR admins can delete punches(DELETE)Managers and HR can edit punches(UPDATE)
hr_timesheet_entries
RLS: ✅ enabled (5 policies)
Foreign keys:
organization_id→pf_organizations(id)punch_in_id→hr_time_punches(id)punch_out_id→hr_time_punches(id)timesheet_id→hr_timesheets(id)
Users can view accessible entries(SELECT)hr_timesheet_entries_delete(DELETE)hr_timesheet_entries_insert(INSERT)hr_timesheet_entries_select(SELECT)hr_timesheet_entries_update(UPDATE)
hr_timesheets
RLS: ✅ enabled (4 policies)
Foreign keys:
approved_by→pf_profiles(id)created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
Employees can view own timesheets(SELECT)HR admins can delete timesheets(DELETE)Managers and HR can update timesheets(UPDATE)hr_timesheets_org_insert(INSERT)
hr_total_compensation_statements
Total compensation statements for employees
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)employee_id→hr_employees(id)organization_id→pf_organizations(id)updated_by→pf_profiles(id)
hr_tcs_delete(DELETE)hr_tcs_insert(INSERT)hr_tcs_select(SELECT)hr_tcs_update(UPDATE)
hr_workload_accuracy_tracking
RLS: ✅ enabled (2 policies)
Foreign keys:
driver_id→hr_workload_drivers(id)organization_id→pf_organizations(id)
hr_workload_accuracy_tracking_insert(INSERT)hr_workload_accuracy_tracking_select(SELECT)
hr_workload_approvals
RLS: ✅ enabled (3 policies)
Foreign keys:
approved_by→pf_profiles(id)driver_id→hr_workload_drivers(id)organization_id→pf_organizations(id)rejected_by→pf_profiles(id)requested_by→pf_profiles(id)scenario_id→hr_workload_scenarios(id)
hr_workload_approvals_insert(INSERT)hr_workload_approvals_select(SELECT)hr_workload_approvals_update(UPDATE)
hr_workload_calculations
RLS: ✅ enabled (4 policies)
Foreign keys:
driver_id→hr_workload_drivers(id)organization_id→pf_organizations(id)shift_id→hr_shifts(id)shift_template_id→hr_shift_templates(id)site_id→pf_sites(id)
hr_workload_calculations_delete(DELETE)hr_workload_calculations_insert(INSERT)hr_workload_calculations_select(SELECT)hr_workload_calculations_update(UPDATE)
hr_workload_driver_versions
RLS: ✅ enabled (2 policies)
Foreign keys:
changed_by→pf_profiles(id)driver_id→hr_workload_drivers(id)
hr_workload_driver_versions_insert(INSERT)hr_workload_driver_versions_select(SELECT)
hr_workload_drivers
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)organization_id→pf_organizations(id)parent_driver_id→hr_workload_drivers(id)position_id→hr_positions(id)shift_template_id→hr_shift_templates(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_workload_drivers_delete(DELETE)hr_workload_drivers_insert(INSERT)hr_workload_drivers_select(SELECT)hr_workload_drivers_update(UPDATE)
hr_workload_forecasts
RLS: ✅ enabled (4 policies)
Foreign keys:
created_by→pf_profiles(id)driver_id→hr_workload_drivers(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→users(id)
hr_workload_forecasts_delete(DELETE)hr_workload_forecasts_insert(INSERT)hr_workload_forecasts_select(SELECT)hr_workload_forecasts_update(UPDATE)
hr_workload_pto_patterns
RLS: ✅ enabled (4 policies)
Foreign keys:
organization_id→pf_organizations(id)position_id→hr_positions(id)site_id→pf_sites(id)
hr_workload_pto_patterns_delete(DELETE)hr_workload_pto_patterns_insert(INSERT)hr_workload_pto_patterns_select(SELECT)hr_workload_pto_patterns_update(UPDATE)
hr_workload_scenarios
RLS: ✅ enabled (4 policies)
Foreign keys:
base_driver_id→hr_workload_drivers(id)created_by→pf_profiles(id)organization_id→pf_organizations(id)site_id→pf_sites(id)updated_by→pf_profiles(id)
hr_workload_scenarios_delete(DELETE)hr_workload_scenarios_insert(INSERT)hr_workload_scenarios_select(SELECT)hr_workload_scenarios_update(UPDATE)