Skip to main content

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 columnItalian original columnTypeNullDefault / GeneratedDescription
ididintegerNOPrimary key identifier for the workplace assignment record.
person_workplace_assignment_idanas_idintegerNOInternal reference ID for the workplace assignment.
person_workplace_relationship_idanas_rap_idintegerNOForeign key referencing the employment relationship (rapporto) of the person.
person_workplace_workplace_idanas_sede_idintegerNOForeign key referencing the workplace location (sede) where the person is assigned.
person_workplace_assigned_fromanas_dalla_datadateNOStart date from which this workplace assignment is effective.
tenant_idtenant_idintegerYESMulti‑tenant isolation column. References cloud._tenant.
colcustomcolcustomjsonbYES'{}'::jsonbJSONB field for custom, tenant‑specific extensions.
_deleted_deletedbooleanYESfalseSoft‑delete flag. When true, the record is considered logically deleted.
person_workplace_assigned_toanas_alla_datadateYESEnd date until which this workplace assignment is effective (optional, can be NULL for open-ended assignments).
person_workplace_assignment_periodanas_periododaterangeYESGENERATED: 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

ConstraintLocal columnsReferencesReferenced columnsOn updateOn delete
fk_person_workplace_assignments_tenanttenant_idcloud.tenantsten_internal_idRESTRICTCASCADE

Referenced by

No incoming foreign keys found.

Constraints

  • Primary key: pk_person_workplace_assignmentsid
  • Unique: uk_person_workplace_assignments_assignment_tenantperson_workplace_assignment_id, tenant_id

Indexes

NameUniqueMethodColumns / expression
idx_pwa_tenantNObtreetenant_id
idx_pwa_tenant_assignmentNObtreetenant_id, person_workplace_assignment_id) WHERE (_deleted = false
idx_pwa_tenant_period_gistNOgisttenant_id, person_workplace_assignment_period) WHERE (_deleted = false
idx_pwa_tenant_relationshipNObtreetenant_id, person_workplace_relationship_id) WHERE (_deleted = false
idx_pwa_tenant_relationship_period_gistNOgisttenant_id, person_workplace_relationship_id, person_workplace_assignment_period) WHERE (_deleted = false
idx_pwa_tenant_workplaceNObtreetenant_id, person_workplace_workplace_id) WHERE (_deleted = false