Skip to content

Improve traceability #8

@PatrickOnGit

Description

@PatrickOnGit

Data tables should contain time stamps to track changes.
For instance to automatically add timestamp when changing information in AP_Rundata:

PRAGMA writable_schema = on;
 
UPDATE sqlite_master
SET sql = replace(sql, 'DEFAULT 0',
                       'DEFAULT CURRENT_TIMESTAMP')
WHERE type = 'table'
  AND name = 'AP_Rundata';
 
PRAGMA writable_schema = off;

CREATE TRIGGER UpdateLastTime UPDATE OF  OB_runvalue, OB_legacyvalue ON AP_Rundata
BEGIN
  UPDATE AP_Rundata SET TimeStamp=CURRENT_TIMESTAMP WHERE OB_item=NEW.OB_item;
END;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions