Skip to main content

hr.expense_note_attachments

Schema: hr
English table: hr.expense_note_attachments
Italian original table: hr.in_notaspese_allegati
Description: Expense note attachments linked to expense note lines (binary payload stored in table). Soft-delete via _deleted.

Overview

  • Columns: 9
  • Primary key: id
  • Outgoing foreign keys: 2
  • Incoming foreign keys: 0
  • Indexes: 3

Columns

English columnItalian original columnTypeNullDefault / GeneratedDescription
ididintegerNOSurrogate primary key.
ena_idnsa_idintegerNOLogical attachment identifier (unique per tenant).
ena_enl_idnsa_nsd_idintegerNOReference to the expense note line this attachment belongs to (enl_id).
ena_filenamensa_nomefilecharacter varying(100)NOOriginal file name as uploaded/stored.
ena_filensa_filebyteaNOBinary file content (bytea).
ena_file_typensa_tipocharacter varying(100)NOFile type information (e.g., MIME type or attachment classification, depending on application usage).
tenant_idtenant_idintegerYESTenant identifier for data isolation.
colcustomcolcustomjsonbYES'{}'::jsonbCustom fields (JSONB).
_deleted_deletedbooleanYESfalseTechnical soft delete flag (not a functional deletion).

Relationships

Outgoing foreign keys

ConstraintLocal columnsReferencesReferenced columnsOn updateOn delete
fk_ena_enl_id_tenantena_enl_id, tenant_idhr.expense_note_linesenl_id, tenant_idRESTRICTRESTRICT
fk_ena_tenant_idtenant_idcloud.tenantsten_internal_idRESTRICTCASCADE

Referenced by

No incoming foreign keys found.

Constraints

  • Primary key: pk_expense_note_attachmentsid
  • Unique: uk_ena_id_tenantena_id, tenant_id

Indexes

NameUniqueMethodColumns / expression
idx_expense_note_attachments_ena_enl_id_tenantNObtreetenant_id, ena_enl_id) WHERE (_deleted = false
idx_expense_note_attachments_ena_id_tenantNObtreetenant_id, ena_id) WHERE (_deleted = false
idx_expense_note_attachments_tenantNObtreetenant_id