hr.employment_position_assignments
Schema: hr
English table: hr.employment_position_assignments
Italian original table: hr.rapporti_ruoli
Description: Links employment relationships to internal organizational positions, including time validity and allocation percentage.
Overview
- Columns: 11
- Primary key: id
- Outgoing foreign keys: 3
- Incoming foreign keys: 0
- Indexes: 6
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
epa_id | rapru_id | integer | NO | Logical assignment identifier (unique per tenant). | |
epa_er_id | rapru_rap_id | integer | NO | Reference to the specific employment relationship. | |
epa_position_code_id | rapru_ru_id | integer | NO | Reference to the internal organizational position (hr.positions). | |
epa_percentage | rapru_percetage | numeric(5,2) | NO | Allocation percentage for the role within the period. | |
epa_start_date | rapru_dal | date | NO | Assignment start date. | |
tenant_id | tenant_id | integer | YES | Tenant identifier (multi-tenant isolation). | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields payload (JSON). |
_deleted | _deleted | boolean | YES | false | Technical soft-delete flag. |
epa_end_date | rapru_al | date | YES | Assignment end date. | |
epa_period | rapru_periodo | daterange | YES | GENERATED: daterange(epa_start_date, epa_end_date, '[]'::text) | Assignment validity period as daterange [start_date, end_date]. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_epa_employment_relationship | epa_er_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_epa_position | epa_position_code_id, tenant_id | hr.job_roles | jr_code_id, tenant_id | RESTRICT | RESTRICT |
fk_epa_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_epa→id - Unique:
uk_epa_id_tenant→epa_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_epa_er_tenant | NO | btree | tenant_id, epa_er_id) WHERE (_deleted = false |
idx_epa_id_tenant | NO | btree | tenant_id, epa_id) WHERE (_deleted = false |
idx_epa_position_tenant | NO | btree | tenant_id, epa_position_code_id) WHERE (_deleted = false |
idx_epa_tenant | NO | btree | tenant_id |
idx_epa_tenant_er_period_gist | NO | gist | tenant_id, epa_er_id, epa_period) WHERE (_deleted = false |
idx_epa_tenant_period_gist | NO | gist | tenant_id, epa_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)