tbl_okr_template_history

-1 rows


Description

Module: Objectives and Key results (OKR)
Purpose: Stores an immutable, time-stamped history of changes made to master OKR templates (the structure of goals, weightage, and review periods).
Data: Captures the template name, frequency, total goals/weightage, and the complete JSON structure of the Objectives and Key Results defined in the template at the time of the change.
Process Usage:
- A new record is created whenever the corresponding live template in tbl_okr_template is created or modified.
- Used for auditing template changes and ensuring that an assigned OKR cycle always uses the exact template definition that was active at the time of assignment.
Key Points:
- Immutability: Essential for compliance and ensuring consistency in goal assignment.
- JSON Content: The template_fields column is critical as it holds the full structural definition of the Objective/KR hierarchy.
Business Impact: Guarantees that historical performance reviews are linked to the correct, original goal definitions.

Columns

Column Type Size Nulls Auto Default Children Parents Comments
id bigserial 19 nextval('tbl_okr_template_history_id_seq'::regclass)

Primary key
Format: Long (auto-increment)
Used as: Unique identifier for this specific historical version of the OKR template.

template_id int8 19 null

FK: public.tbl_okr_template.id
Meaning: The ID of the master OKR template this history entry relates to.

template_name varchar 200 null

The name of the OKR template in this historical version.

review_frequency varchar 20 null

The specified frequency for progress reviews (e.g., QUARTERLY, MONTHLY) in this version.

period_type varchar 20 null

The standard duration type for the cycle defined by the template (e.g., YEARLY, HALF_YEARLY).

period_range varchar 50 null

A string representation of the template’s date range or period (e.g., Q1 2025).

total_tasks int4 10 null

The total count of objectives and key results defined in the template in this historical version.

total_weightage float8 17,17 null

The sum of the weightage of all goals defined in the template (should typically be 100).

is_delete bool 1 null

Soft-delete flag: Indicates if the parent master template was logically deleted at the time this history record was created.

template_fields text 2147483647 null

JSON data string containing the detailed hierarchical structure of all Objectives, Key Results, and their properties as defined in this template version.

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

Indexes

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

Relationships