pres.employee_shift_assignments
Schema: pres
English table: pres.employee_shift_assignments
Italian original table: pres.profora_assign
Description: Assignment of weekly shift schemas to employees over time.
Overview
- Columns: 8
- Primary key: id
- Outgoing foreign keys: 3
- Incoming foreign keys: 0
- Indexes: 3
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|
id | id | integer | NO | | Surrogate primary key. |
esa_id | orass_id | integer | NO | | Logical identifier of the assignment (unique per tenant). |
tenant_id | tenant_id | integer | NO | | Tenant identifier for data isolation. |
esa_start_date | orass_dalla_data | date | NO | | Assignment start date. |
esa_end_date | orass_alla_data | date | NO | | Assignment end date. |
esa_shift_schema_code | orass_cod_profora | character(4) | NO | ''::bpchar | Reference to the weekly shift schema code. |
esa_employment_relationship_id | orass_rap_id | integer | NO | 0 | Reference to the employment relationship. |
esa_period | orass_periodo | daterange | YES | GENERATED: daterange(esa_start_date, esa_end_date, '[]'::text) | Date range of the assignment. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|
fk_esa_shift_schema | tenant_id, esa_shift_schema_code | pres.weekly_shift_schemas | tenant_id, wss_code | CASCADE | RESTRICT |
fk_esa_employment_relationship | tenant_id, esa_employment_relationship_id | hr.employment_relationships | tenant_id, er_id | RESTRICT | CASCADE |
fk_profora_assign_tenant_id_to_tenant | tenant_id | cloud.tenants | ten_internal_id | CASCADE | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
employee_shift_assignments_pkey → id
- Unique:
profora_assign_orass_id_key → tenant_id, esa_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|
idx_employee_shift_assignments_schema_code | NO | btree | tenant_id, esa_shift_schema_code |
idx_employee_shift_assignments_period | NO | gist | esa_period |
idx_employee_shift_assignments_er_id | NO | btree | tenant_id, esa_employment_relationship_id |
Navigation