hr.customer_employment_links
Schema: hr
English table: hr.customer_employment_links
Italian original table: hr.in_clienti_link
Description: Links employees (employment relationships) to customers for a specific time period.
Overview
- Columns: 10
- Primary key: id
- Outgoing foreign keys: 3
- Incoming foreign keys: 0
- Indexes: 7
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Internal surrogate primary key. | |
cel_id | inclil_id | integer | NO | Unique identifier for the link record within a tenant. | |
cel_customer_id | inclil_incli_id | integer | NO | Reference to the customer (hr.customers). | |
cel_employment_relationship_id | inclil_rap_id | integer | NO | Reference to the employee relationship (hr.employment_relationships). | |
cel_valid_from | inclil_dal | date | NO | Start date of the assignment. | |
cel_valid_to | inclil_al | date | NO | End date of the assignment. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON field for custom data. |
_deleted | _deleted | boolean | YES | false | Technical soft delete flag. |
cel_validity_period | inclil_periodo | daterange | YES | GENERATED: daterange(cel_valid_from, cel_valid_to, '[]'::text) | Generated daterange for the assignment validity. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_customer_employment_links_customer | cel_customer_id, tenant_id | hr.customers | cust_id, tenant_id | RESTRICT | RESTRICT |
fk_customer_employment_links_employment | cel_employment_relationship_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_customer_employment_links_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_customer_employment_links→id - Unique:
uk_customer_employment_links_id→cel_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_cel_customer_tenant | NO | btree | tenant_id, cel_customer_id) WHERE (_deleted = false |
idx_cel_employment_tenant | NO | btree | tenant_id, cel_employment_relationship_id) WHERE (_deleted = false |
idx_cel_id_tenant | NO | btree | tenant_id, cel_id) WHERE (_deleted = false |
idx_cel_tenant | NO | btree | tenant_id |
idx_cel_tenant_customer_period_gist | NO | gist | tenant_id, cel_customer_id, cel_validity_period) WHERE (_deleted = false |
idx_cel_tenant_employment_period_gist | NO | gist | tenant_id, cel_employment_relationship_id, cel_validity_period) WHERE (_deleted = false |
idx_cel_tenant_period_gist | NO | gist | tenant_id, cel_validity_period) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)