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 column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
pcz_id | anacit_id | integer | NO | Logical record identifier (unique per tenant). | |
pcz_person_id | anacit_ana_id | integer | NO | Person identifier. FK to hr.person_registry(pr_id, tenant_id). | |
pcz_citizenship_id | anacit_xcit_id | integer | NO | Citizenship lookup identifier. FK to hr.x_cittadinanza (to be translated). | |
pcz_from_date | anacit_dal | date | NO | Validity start date. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields (JSON). |
_deleted | _deleted | boolean | YES | false | Technical soft-delete flag. |
pcz_to_date | anacit_al | date | YES | Validity end date (nullable for open-ended). | |
pcz_period | anacit_periodo | daterange | YES | GENERATED: daterange(pcz_from_date, pcz_to_date, '[]'::text) | Validity period as daterange (derived from from/to dates). |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_pcz_citizenship_id | pcz_citizenship_id, tenant_id | hr.x_citizenship | xct_id, tenant_id | RESTRICT | RESTRICT |
fk_pcz_person_id | pcz_person_id, tenant_id | hr.person_registry | pr_id, tenant_id | RESTRICT | CASCADE |
fk_pcz_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_person_citizenship→id - Unique:
uk_pcz_id_tenant→pcz_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_pcz_citizenship_id_tenant | NO | btree | tenant_id, pcz_citizenship_id) WHERE (_deleted = false |
idx_pcz_id_tenant | NO | btree | tenant_id, pcz_id) WHERE (_deleted = false |
idx_pcz_person_id_tenant | NO | btree | tenant_id, pcz_person_id) WHERE (_deleted = false |
idx_pcz_tenant_period_gist | NO | gist | tenant_id, pcz_period) WHERE (_deleted = false |
idx_pcz_tenant_person_period_gist | NO | gist | tenant_id, pcz_person_id, pcz_period) WHERE (_deleted = false |
idx_person_citizenship_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)