hr.document_logs
Schema: hr
English table: hr.document_logs
Italian original table: hr.in_documents_log
Description: Audit log for document-related operations.
Overview
- Columns: 13
- 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. | |
dl_id | docl_id | integer | NO | Logical identifier of the document log record (unique per tenant). | |
dl_document_id | docl_doc_id | integer | NO | Reference to the document. | |
dl_employment_relationship_id | docl_rap_id | integer | YES | Reference to the employment relationship (if applicable). | |
dl_date | docl_date | date | NO | Date of the operation. | |
dl_time | docl_time | integer | NO | Time of the operation. | |
dl_action_id | docl_dmsa_id | integer | NO | Reference to the action performed (DMS action). | |
dl_delegate_id | docl_delegato_id | integer | NO | Reference to the delegate/user performing the action. | |
dl_is_admin | docl_admin | boolean | NO | Indicates whether the action was performed by an administrator. | |
dl_attachment_id | docl_file_allegato | integer | NO | Reference to the attached file. | |
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. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_dl_document | dl_document_id, tenant_id | hr.documents | doc_id, tenant_id | RESTRICT | RESTRICT |
fk_dl_employment_relationship | dl_employment_relationship_id, tenant_id | hr.employment_relationships | er_id, tenant_id | RESTRICT | CASCADE |
fk_tenant_id | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
No incoming foreign keys found.
Constraints
- Primary key:
document_logs_pkey→id - Unique:
k_docl_id_unique→dl_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_document_logs_dl_delegate_id_tenant | NO | btree | tenant_id, dl_delegate_id) WHERE (_deleted = false |
idx_document_logs_dl_action_id_tenant | NO | btree | tenant_id, dl_action_id) WHERE (_deleted = false |
idx_document_logs_dl_document_id_tenant | NO | btree | tenant_id, dl_document_id) WHERE (_deleted = false |
idx_document_logs_dl_id_tenant | NO | btree | tenant_id, dl_id) WHERE (_deleted = false |
idx_document_logs_dl_er_id_tenant | NO | btree | tenant_id, dl_employment_relationship_id) WHERE (_deleted = false |
idx_document_logs_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)