hr_Table Count: 85
Last Updated: 2026-02-08
Overview
The HR module covers employee records, recruitment (ATS), onboarding/offboarding, time and attendance, leave, payroll, benefits, credentials, skills, and employee relations.Table Categories
1. Core Employee Management (5 tables)
Key Fields in
hr_employees:
employee_number: Unique identifierstatus: ‘active’, ‘inactive’, ‘terminated’, ‘on_leave’employment_type: ‘full_time’, ‘part_time’, ‘contractor’, ‘intern’ssn_encrypted: Encrypted SSN (column-level encryption)custom_fields: JSONB for org-specific data
2. Recruitment / ATS (10 tables)
Hiring Pipeline:
3. Onboarding & Offboarding (6 tables)
4. Time & Attendance (9 tables)
Time Entry Pattern:
5. Leave Management (5 tables)
Leave Types:
- PTO (Paid Time Off)
- Sick Leave
- Vacation
- Personal
- FMLA
- Bereavement
- Jury Duty
- Military
6. Payroll (9 tables)
Security Notes:
- SSN stored with column-level encryption
- All SSN access logged to
hr_ssn_access_log - Payroll changes tracked in
hr_payroll_audit_log
7. Benefits (6 tables)
8. Credentials & Certifications (5 tables)
Credential Tracking:
9. Skills & Competencies (6 tables)
10. Positions (1 table)
Position Fields:
title,description,department_idpay_grade,min_salary,max_salaryreports_to_position_id(hierarchy)headcount_authorized,headcount_filled
11. Employee Relations (4 tables)
ER Workflow:
12. Workload Planning (8 tables)
13. Module Settings (1 table)
14. ATS Enhanced (10 tables)
Reference Checking Workflow:
Common Query Patterns
Get Employee with Related Data
Get Team Members
Leave Balance Check
RLS Policies
HR tables use layered RLS:- Organization isolation via
organization_id - Manager access to direct reports
- Self-service for employee’s own data
- HR admin access for sensitive operations
hr_user_can_view_employee()- View permission checkhr_user_can_edit_employee()- Edit permission checkhr_user_is_manager_of()- Manager relationship check