tbl_documenthistory

-1 rows


Description

Module: HRMS Document Module
Purpose: Provides complete, immutable audit trail for all changes to document records in the system.
Data: Each row represents a historical snapshot of a document record at the time of modification, preserving the exact state for compliance and tracking.
Process Usage:
- Automatically populated via system triggers or application logic when documents are created, updated, or deleted.
- Used by administrators and auditors to review document lifecycle and changes.
- Essential for compliance reporting and dispute resolution regarding policy changes.
Key Points:
- Immutable record of all document modifications for legal and compliance requirements.
- Preserves complete document state including targeting criteria and access controls.
- Enables point-in-time reconstruction of document versions.
Business Impact: Critical for regulatory compliance, audit requirements, and maintaining historical accuracy of policy and document changes.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id serial 10 nextval('tbl_documenthistory_id_seq'::regclass)

Primary key
Format: Long (auto-increment)
Used as: Unique identifier for each historical event record.

documentid int8 19 null
hr_documentmaster.documentid Implied Constraint R

FK: public.tbl_document.id
Purpose: Links this historical record to the current/live document record.
Usage: Enables tracking all historical versions of a specific document.
Audit Value: Maintains relationship while preserving historical accuracy.

documentcategoryid int8 19 null

Historical Snapshot: Category ID at the time of the change event.
Purpose: Preserves document categorization for historical accuracy.
Audit Use: Tracks how document classification evolved over time.

documentcategoryname text 2147483647 null

Historical Snapshot: Category name at the time of the change event.
Purpose: Maintains human-readable category context for historical reporting.
Examples: “HR MANNUAL”, “Compliance”, “Policies” as they were named historically.

documentname text 2147483647 null

Historical Snapshot: Document name/title at the time of the change.
Purpose: Preserves document naming conventions and title changes.
Audit Value: Tracks document rebranding, naming standardization, or content focus changes.

documentdescription text 2147483647 null

Historical Snapshot: Document description as it existed during the change.
Purpose: Maintains historical context of document purpose and scope.
Compliance Value: Essential for understanding policy intent at specific points in time.

applicablecriteria text 2147483647 null

Historical Snapshot: JSON criteria rules active at the time of change.
Purpose: Preserves exactly which employee groups were targeted by the document.
Legal Significance: Critical for compliance disputes regarding policy distribution.
Examples: Historical SBU filters, department rules, and eligibility criteria.

acknowledgementrequired bool 1 false

Historical Snapshot: Acknowledgment requirement setting at change time.
Purpose: Tracks when documents became mandatory or optional for acknowledgment.
Compliance Impact: Essential for legal disputes about mandatory policy acceptance.

content text 2147483647 null

Historical Snapshot: Document content/body at the time of change.
Purpose: Preserves the actual policy text, guidelines, or document content.
Critical For: Legal disputes about policy wording, compliance requirements, and contractual terms.

downloadrequired bool 1 false

Historical Snapshot: Download requirement setting at change time.
Purpose: Preserves historical access control methods for documents.
Audit Use: Tracks changes in document distribution strategies.

showtoemployee bool 1 true

Historical Snapshot: Employee visibility setting at change time.
Purpose: Maintains record of when documents were made visible or hidden from employees.
Legal Value: Important for transparency and access right disputes.

attachment text 2147483647 null

Historical Snapshot: File attachment reference at the time of change.
Purpose: Links to the specific version of the document file that was active.
Storage: Should point to archived versions of document files for complete historical preservation.
Examples: “HR_MANUAL_1733392584982.pdf”, “COC_1674195121797.pdf” with version tracking.

status bool 1 true

Historical Snapshot: Active/Inactive status at the time of change.
Purpose: Tracks document lifecycle states throughout its history.
Workflow Tracking: Documents activation, deactivation, and retirement events.

createdby varchar 500 null
createddate timestamp 29,6 null
modifiedby varchar 500 null
modifieddate timestamp 29,6 null

Indexes

Constraint Name Type Sort Column(s)
tbl_documenthistory_pkey Primary key Asc id

Relationships