hr.employee_secondments
Schema: hr
English table: hr.employee_secondments
Italian original table: hr.rapporti_distaccati
Description: Employee secondments — temporary assignments to different roles, locations or companies.
Overview
- Columns: 10
- 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. | |
es_id | rapdi_id | integer | NO | Logical identifier of the secondment (unique per tenant). | |
es_employment_relationship_id | rapdi_rap_id | integer | NO | Reference to the employment relationship. | |
es_secondment_type_id | rapdi_xdi_id | integer | NO | Reference to the secondment type. | |
es_start_date | rapdi_dal | date | NO | Secondment start date. | |
es_end_date | rapdi_al | date | NO | Secondment end date. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON payload containing additional attributes. |
_deleted | _deleted | boolean | YES | false | Flag indicating whether the record is soft-deleted. |
es_period | rapdi_periodo | daterange | YES | GENERATED: daterange(es_start_date, es_end_date, '[]'::text) | Date range of the secondment. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_es_employment_relationship | es_employment_relationship_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_es_secondment_type | es_secondment_type_id, tenant_id | hr.x_secondment_types | xst_id, tenant_id | RESTRICT | RESTRICT |
fk_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
employee_secondments_pkey→id - Unique:
uk_es_id_tenant→es_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_employee_secondments_es_id_tenant | NO | btree | tenant_id, es_id) WHERE (_deleted = false |
idx_employee_secondments_es_employment_relationship_id_tenant | NO | btree | tenant_id, es_employment_relationship_id) WHERE (_deleted = false |
idx_employee_secondments_es_secondment_type_id_tenant | NO | btree | tenant_id, es_secondment_type_id) WHERE (_deleted = false |
idx_employee_secondments_tenant | NO | btree | tenant_id |
idx_employee_secondments_tenant_es_period_gist | NO | gist | tenant_id, es_period) WHERE (_deleted = false |
idx_employee_secondments_tenant_es_er_period_gist | NO | gist | tenant_id, es_employment_relationship_id, es_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)