hr.organization_unit_links
Schema: hr
English table: hr.organization_unit_links
Italian original table: hr.organigramma_link
Description: Links employment relationships to organization units with a validity period (multi-tenant).
Overview
- Columns: 10
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 7
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
oul_code | orgli_id | integer | NO | Business identifier for the organization unit link (unique per tenant). | |
oul_employment_relationship_id | orgli_rap_id | integer | NO | Employment relationship identifier associated with the organization unit assignment. | |
oul_organization_unit_id | orgli_org_id | integer | NO | Organization unit identifier. | |
oul_valid_from | orgli_dalla_data | date | NO | Start date (inclusive) of the assignment validity. | |
oul_valid_to | orgli_alla_data | date | NO | End date (inclusive) of the assignment validity. | |
tenant_id | tenant_id | integer | YES | Tenant identifier. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields stored as JSON. |
_deleted | _deleted | boolean | YES | false | Soft delete flag (technical). |
oul_valid_period | orgli_periodo | daterange | YES | GENERATED: daterange(oul_valid_from, oul_valid_to, '[]'::text) | Generated validity period as a daterange derived from valid_from and valid_to (inclusive). |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_oul_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_organization_unit_links→id - Unique:
uk_oul_code_tenant→oul_code, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_oul_tenant | NO | btree | tenant_id |
idx_oul_tenant_code | NO | btree | tenant_id, oul_code) WHERE (_deleted = false |
idx_oul_tenant_empr | NO | btree | tenant_id, oul_employment_relationship_id) WHERE (_deleted = false |
idx_oul_tenant_empr_period_gist | NO | gist | tenant_id, oul_employment_relationship_id, oul_valid_period) WHERE (_deleted = false |
idx_oul_tenant_period_gist | NO | gist | tenant_id, oul_valid_period) WHERE (_deleted = false |
idx_oul_tenant_unit | NO | btree | tenant_id, oul_organization_unit_id) WHERE (_deleted = false |
idx_oul_tenant_unit_period_gist | NO | gist | tenant_id, oul_organization_unit_id, oul_valid_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)