hr.attachments
Schema: hr
English table: hr.attachments
Italian original table: hr.allegati
Description: Attachments linked to HR entities (people, employments, events and document types), with soft-delete support.
Overview
- Columns: 20
- Primary key: id
- Outgoing foreign keys: 1
- Incoming foreign keys: 0
- Indexes: 12
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
att_attachment_id | al_id | integer | NO | Logical attachment identifier (unique per tenant). | |
att_reference_table_id | al_id_tabella_riferimento | integer | NO | Identifier of the referenced table/entity the attachment belongs to. | |
att_description | al_descrizione | text | NO | Attachment description. | |
att_paths | al_pathnames | text | NO | Stored paths or locations associated with the attachment. | |
att_file_name | al_nome_file | character varying(250) | NO | Original file name of the attachment. | |
att_type_code | al_tipo | character varying(4) | NO | Attachment type code. | |
att_uploaded_on | al_data_upload | date | NO | Upload date. | |
att_notes | al_note | text | NO | Additional notes about the attachment. | |
att_employment_relationship_id | al_rap_id | integer | NO | Employment relationship identifier associated with the attachment. | |
att_is_confirmed | al_confermato | boolean | NO | Indicates whether the attachment has been confirmed/validated. | |
att_is_printed | al_stampato | boolean | NO | Indicates whether the attachment has been printed. | |
att_event_id | al_eve_id | integer | NO | Event identifier associated with the attachment. | |
att_person_id | al_ana_id | integer | NO | Person identifier associated with the attachment. | |
att_expires_on | al_data_scadenza | date | NO | Expiration date of the attachment, if applicable. | |
att_document_type_id | al_doc_id | integer | NO | Document type identifier associated with the attachment. | |
al_inclia_id | tenant_id | integer | NO | Identifier of the related al inclia record. | |
tenant_id | colcustom | integer | YES | Tenant identifier for row-level security and data partitioning. | |
colcustom | _deleted | jsonb | YES | '{}'::jsonb | Custom fields in JSON format. |
_deleted | `` | boolean | YES | false | Soft-delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_att_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
pk_attachments→id - Unique:
uk_att_id_tenant→att_attachment_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_att_tenant | NO | btree | tenant_id |
idx_att_tenant_att | NO | btree | tenant_id, att_attachment_id) WHERE (_deleted = false |
idx_att_tenant_doc_type | NO | btree | tenant_id, att_document_type_id) WHERE (_deleted = false |
idx_att_tenant_emp | NO | btree | tenant_id, att_employment_relationship_id) WHERE (_deleted = false |
idx_att_tenant_emp_person_ref | NO | btree | tenant_id, att_employment_relationship_id, att_person_id, att_reference_table_id) WHERE (_deleted = false |
idx_att_tenant_emp_person_ref_doc | NO | btree | tenant_id, att_employment_relationship_id, att_person_id, att_reference_table_id, att_document_type_id) WHERE (_deleted = false |
idx_att_tenant_event | NO | btree | tenant_id, att_event_id) WHERE (_deleted = false |
idx_att_tenant_expires | NO | btree | tenant_id, att_expires_on) WHERE (_deleted = false |
idx_att_tenant_expires_emp | NO | btree | tenant_id, att_expires_on, att_employment_relationship_id) WHERE (_deleted = false |
idx_att_tenant_person | NO | btree | tenant_id, att_person_id) WHERE (_deleted = false |
idx_att_tenant_type | NO | btree | tenant_id, att_type_code) WHERE (_deleted = false |
idx_att_tenant_type_ref | NO | btree | tenant_id, att_type_code, att_reference_table_id) WHERE (_deleted = false |
Navigation
- Back to main index
- [Back to
hrindex]../)