Difference between revisions of "VbzCart/tables/cache log"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(got rid of redundant fields; added more user ID)
(consolidating two usernames down to one)
Line 6: Line 6:
 
** '''2009-03-24''' Belatedly realized that it makes no sense to log source and destination each time; running the procedure updates a preset destination (a given function always updates the same destination) from ''all'' the function's sources.
 
** '''2009-03-24''' Belatedly realized that it makes no sense to log source and destination each time; running the procedure updates a preset destination (a given function always updates the same destination) from ''all'' the function's sources.
 
*** Also added VbzUser, SysUser, and Machine, while I'm here (to be consistent with {{vbzcart/table|event_log}}). Sure, some updates are automatic, but some aren't.
 
*** Also added VbzUser, SysUser, and Machine, while I'm here (to be consistent with {{vbzcart/table|event_log}}). Sure, some updates are automatic, but some aren't.
 +
** '''2009-03-25''' "VbzUser" makes this subsystem too interdependent with [[VbzCart]], so reducing to just one user field (Username). The system initiating the cache update may prefix the username with a qualifier (e.g. "vbz:", "wiki:", "sys:", or whatever seems appropriate; it's for human consumption and doesn't need to match a key anywhere else).
 
==SQL==
 
==SQL==
 
<section begin=sql /><mysql>DROP TABLE IF EXISTS `data_log`;
 
<section begin=sql /><mysql>DROP TABLE IF EXISTS `data_log`;
Line 11: Line 12:
 
CREATE TABLE `data_log` (
 
CREATE TABLE `data_log` (
 
     ID INT NOT NULL AUTO_INCREMENT  COMMENT "log line identifier",
 
     ID INT NOT NULL AUTO_INCREMENT  COMMENT "log line identifier",
     WhenStarted    DATETIME NOT NULL COMMENT "when this event was started",
+
     WhenStarted    DATETIME NOT NULL COMMENT "when this update was started",
 
     WhenFinished  DATETIME          COMMENT "when it was completed (NULL = it wasn't)",
 
     WhenFinished  DATETIME          COMMENT "when it was completed (NULL = it wasn't)",
 
     ID_Proc        INT NOT NULL      COMMENT "data_procs.ID of stored procedure used",
 
     ID_Proc        INT NOT NULL      COMMENT "data_procs.ID of stored procedure used",
 
     Caller        VARCHAR(63)      COMMENT "identifying string from code which caused the update",
 
     Caller        VARCHAR(63)      COMMENT "identifying string from code which caused the update",
     VbzUser        VARCHAR(255)      COMMENT "VbzCart user, if any",
+
     Username      VARCHAR(255)      COMMENT "identifier of user who initiated the change, if known",
    SysUser        VARCHAR(127)      COMMENT "Computer username, if any",
+
     Machine        VARCHAR(64)      COMMENT "Network name (or IP address) of computer initiating the update, if any",
     Machine        VARCHAR(64)      COMMENT "Network name (or IP address) of computer initiating the change, if any",
 
 
     Notes          VARCHAR(255)      COMMENT "historical human-created notes",
 
     Notes          VARCHAR(255)      COMMENT "historical human-created notes",
 
     PRIMARY KEY (`ID`)
 
     PRIMARY KEY (`ID`)

Revision as of 12:18, 25 March 2009

About

  • Purpose: Log of all cache updates performed
  • Notes:
    • The stored procedures don't automatically update this log; that is handled by the DataMgr classes.
  • History:
    • 2009-03-24 Belatedly realized that it makes no sense to log source and destination each time; running the procedure updates a preset destination (a given function always updates the same destination) from all the function's sources.
      • Also added VbzUser, SysUser, and Machine, while I'm here (to be consistent with
  1. REDIRECT Template:l/vc/table). Sure, some updates are automatic, but some aren't.
    • 2009-03-25 "VbzUser" makes this subsystem too interdependent with VbzCart, so reducing to just one user field (Username). The system initiating the cache update may prefix the username with a qualifier (e.g. "vbz:", "wiki:", "sys:", or whatever seems appropriate; it's for human consumption and doesn't need to match a key anywhere else).

SQL

<mysql>DROP TABLE IF EXISTS `data_log`;

CREATE TABLE `data_log` (

   ID INT NOT NULL AUTO_INCREMENT   COMMENT "log line identifier",
   WhenStarted    DATETIME NOT NULL COMMENT "when this update was started",
   WhenFinished   DATETIME          COMMENT "when it was completed (NULL = it wasn't)",
   ID_Proc        INT NOT NULL      COMMENT "data_procs.ID of stored procedure used",
   Caller         VARCHAR(63)       COMMENT "identifying string from code which caused the update",
   Username       VARCHAR(255)      COMMENT "identifier of user who initiated the change, if known",
   Machine        VARCHAR(64)       COMMENT "Network name (or IP address) of computer initiating the update, if any",
   Notes          VARCHAR(255)      COMMENT "historical human-created notes",
   PRIMARY KEY (`ID`)
) ENGINE = MYISAM;</mysql>

old version

Retired 2009-03-24 <mysql>DROP TABLE IF EXISTS `data_log`;

CREATE TABLE `data_log` (

   ID INT NOT NULL AUTO_INCREMENT COMMENT "log line identifier",
   WhenStarted DATETIME NOT NULL COMMENT "when this event was started",
   WhenFinished DATETIME COMMENT "when it was completed",
   ID_TableDest INT NOT NULL COMMENT "data_tables.ID of table being updated",
   ID_TableSrce INT NOT NULL COMMENT "data_tables.ID of triggering/source table",
   ID_Proc INT NOT NULL COMMENT "data_procs.ID of stored procedure used",
   Caller varchar(63) COMMENT "identifying string from code which caused the update",
   Notes varchar(255) COMMENT "historical human-created notes",
   PRIMARY KEY (`ID`)
) ENGINE = MYISAM;</mysql>