Skip to main content

hr.person_citizenship

Schema: hr
English table: hr.person_citizenship
Italian original table: hr.ana_cittadinanza
Description: Person citizenship history (periodized). Each row links a person to a citizenship type/lookup and defines validity dates (multi-tenant).

Overview

  • Columns: 10
  • Primary key: id
  • Outgoing foreign keys: 3
  • Incoming foreign keys: 0
  • Indexes: 6

Columns

English columnItalian original columnTypeNullDefault / GeneratedDescription
ididintegerNOSurrogate primary key.
pcz_idanacit_idintegerNOLogical record identifier (unique per tenant).
pcz_person_idanacit_ana_idintegerNOPerson identifier. FK to hr.person_registry(pr_id, tenant_id).
pcz_citizenship_idanacit_xcit_idintegerNOCitizenship lookup identifier. FK to hr.x_cittadinanza (to be translated).
pcz_from_dateanacit_daldateNOValidity start date.
tenant_idtenant_idintegerYESTenant identifier for data isolation.
colcustomcolcustomjsonbYES'{}'::jsonbCustom fields (JSON).
_deleted_deletedbooleanYESfalseTechnical soft-delete flag.
pcz_to_dateanacit_aldateYESValidity end date (nullable for open-ended).
pcz_periodanacit_periododaterangeYESGENERATED: daterange(pcz_from_date, pcz_to_date, '[]'::text)Validity period as daterange (derived from from/to dates).

Relationships

Outgoing foreign keys

ConstraintLocal columnsReferencesReferenced columnsOn updateOn delete
fk_pcz_citizenship_idpcz_citizenship_id, tenant_idhr.x_citizenshipxct_id, tenant_idRESTRICTRESTRICT
fk_pcz_person_idpcz_person_id, tenant_idhr.person_registrypr_id, tenant_idRESTRICTCASCADE
fk_pcz_tenanttenant_idcloud.tenantsten_internal_idRESTRICTCASCADE

Referenced by

No incoming foreign keys found.

Constraints

  • Primary key: pk_person_citizenshipid
  • Unique: uk_pcz_id_tenantpcz_id, tenant_id

Indexes

NameUniqueMethodColumns / expression
idx_pcz_citizenship_id_tenantNObtreetenant_id, pcz_citizenship_id) WHERE (_deleted = false
idx_pcz_id_tenantNObtreetenant_id, pcz_id) WHERE (_deleted = false
idx_pcz_person_id_tenantNObtreetenant_id, pcz_person_id) WHERE (_deleted = false
idx_pcz_tenant_period_gistNOgisttenant_id, pcz_period) WHERE (_deleted = false
idx_pcz_tenant_person_period_gistNOgisttenant_id, pcz_person_id, pcz_period) WHERE (_deleted = false
idx_person_citizenship_tenantNObtreetenant_id