hr.contact_details
Schema: hr
English table: hr.contact_details
Italian original table: hr.recapiti_tel
Description: Polymorphic table storing contact information (phone, email, social) for various entities with temporal validity.
Overview
- Columns: 14
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 7
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
cd_id | rect_id | integer | NO | Identifier of the related cd record. | |
cd_source_table | rect_tabella | character varying(10) | NO | The target table name for this contact (polymorphic reference). | |
cd_source_id | rect_tabella_id | integer | NO | The ID of the record in the target table. | |
cd_type_id | rect_tipo | integer | NO | Identifier of the related cd type record. | |
cd_label | rect_descrizione | character varying(50) | NO | Friendly label for the contact, e.g., "Personal Mobile" or "Work Email". | |
cd_contact_value | rect_telefono | character varying(80) | NO | The actual phone number, email address, or handle. | |
cd_valid_from | rect_dal | date | NO | Boundary value used for range filtering (start/end). | |
cd_notes | rect_note | text | NO | Free-form notes. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | JSON payload containing additional attributes. |
_deleted | _deleted | boolean | YES | false | Flag indicating whether the record is soft-deleted. |
cd_valid_to | rect_al | date | YES | Boundary value used for range filtering (start/end). | |
cd_period | rect_periodo | daterange | YES | GENERATED: daterange(cd_valid_from, cd_valid_to, '[]'::text) | Temporal range of validity (daterange) for this contact detail. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_cd_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_cd→id - Unique:
uk_cd_id_tenant→cd_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_cd_id_tenant | NO | btree | tenant_id, cd_id) WHERE (_deleted = false |
idx_cd_period_gist | NO | gist | tenant_id, cd_period) WHERE (_deleted = false |
idx_cd_polymorphic_tenant | NO | btree | tenant_id, cd_source_table, cd_source_id) WHERE (_deleted = false |
idx_cd_polymorphic_type_tenant | NO | btree | tenant_id, cd_source_table, cd_source_id, cd_type_id) WHERE (_deleted = false |
idx_cd_source_id_tenant | NO | btree | tenant_id, cd_source_id) WHERE (_deleted = false |
idx_cd_source_period_gist | NO | gist | tenant_id, cd_source_table, cd_source_id, cd_period) WHERE (_deleted = false |
idx_cd_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)