hr.person_workplace_assignments
Schema: hr
English table: hr.person_workplace_assignments
Italian original table: hr.ana_sedi
Description: Temporal assignment of persons (employees) to workplace locations (sedi) via their employment relationships.
Overview
- Columns: 10
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 6
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Primary key identifier for the workplace assignment record. | |
person_workplace_assignment_id | anas_id | integer | NO | Internal reference ID for the workplace assignment. | |
person_workplace_relationship_id | anas_rap_id | integer | NO | Foreign key referencing the employment relationship (rapporto) of the person. | |
person_workplace_workplace_id | anas_sede_id | integer | NO | Foreign key referencing the workplace location (sede) where the person is assigned. | |
person_workplace_assigned_from | anas_dalla_data | date | NO | Start date from which this workplace assignment is effective. | |
tenant_id | tenant_id | integer | YES | Multi‑tenant isolation column. References cloud._tenant. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSONB field for custom, tenant‑specific extensions. |
_deleted | _deleted | boolean | YES | false | Soft‑delete flag. When true, the record is considered logically deleted. |
person_workplace_assigned_to | anas_alla_data | date | YES | End date until which this workplace assignment is effective (optional, can be NULL for open-ended assignments). | |
person_workplace_assignment_period | anas_periodo | daterange | YES | GENERATED: daterange(person_workplace_assigned_from, person_workplace_assigned_to, '[]'::text) | Generated daterange column combining assigned_from and assigned_to for efficient range queries. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_person_workplace_assignments_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_person_workplace_assignments→id - Unique:
uk_person_workplace_assignments_assignment_tenant→person_workplace_assignment_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_pwa_tenant | NO | btree | tenant_id |
idx_pwa_tenant_assignment | NO | btree | tenant_id, person_workplace_assignment_id) WHERE (_deleted = false |
idx_pwa_tenant_period_gist | NO | gist | tenant_id, person_workplace_assignment_period) WHERE (_deleted = false |
idx_pwa_tenant_relationship | NO | btree | tenant_id, person_workplace_relationship_id) WHERE (_deleted = false |
idx_pwa_tenant_relationship_period_gist | NO | gist | tenant_id, person_workplace_relationship_id, person_workplace_assignment_period) WHERE (_deleted = false |
idx_pwa_tenant_workplace | NO | btree | tenant_id, person_workplace_workplace_id) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)