platform/log/HistoryChanges

Entity change history collection. Applied to dynamic data model classes with the store_changehistory_mode option enabled. Optionally applied to save changes in platform static collections served by the domain center.

Created by the dc microservice from a built-in fixture. Mostly creation occurs when a domain is created. During domain creation no storages exist, so binding is to the default storage (auto).

After domain configuration (when using the change history saving function), it makes sense to change the storage type and code so that history is stored separately. If history is potentially expected to be large, it makes sense to connect a KAFKA + ClickHouse storage for it. Changing class properties related to storages does not automatically recreate the class.

Contained in any domain.

Storage type: history or transactionlog.

Table 1. Class fields
Field Description

id

Change record identifier

dateTime

Entity change time

user_id

Identifier of the user who made the change

source

Change source: ui – user by session (interface, REST and WebSocket collection API); token:<channel type> – integration channel token, for example token:public, token:mcp; script – script; system – platform service. Some operations (for example, changing one’s own password, uploading an avatar) are recorded with source system or without a source. In the center log, a change from another site preserves the source of the original site. Empty value – source not determined.

className

Name of the class to which the changed entity belongs (the 'classname' field)

kind

Operation type. Possible variants:

  • create - entity created;

  • update - entity partially modified;

  • replace - entity completely replaced;

  • delete - entity deleted;

  • rollback - change revoked due to a save problem;

  • clear - collection cleared;

  • action - reserved;

  • message - reserved;

  • custom - reserved.

entity_id

Identifier of the changed entity or 'null'

entityCaption

Name of the changed entity. For dynamic data model collections it is taken from the field specified in the class 'opts.caption_property' property. For platform static collections it is taken from the 'name', 'key', or 'opts.title' field.

valueDiff

Composition of changed fields. Populated on update and replace modification operations.

valuePrev

Entity value before deletion. Populated on the delete operation.

valueNew

Entity value after creation. Populated on the create operation.

text

Reserved

description

Reserved