FinanceFerret/2.0/sql/event: Difference between revisions

From Woozle Writes Code
< FinanceFerret‎ | 2.0‎ | sql
Jump to navigation Jump to search
m (Woozle moved page FinanceFerret/tables/event to FinanceFerret/2.0/sql/event without leaving a redirect: renumbering - 1.0 is Access version)
(various updates)
 
Line 1: Line 1:
==About==
==About==
* '''Version''': Copied, with only slight changes, from [[VbzCart tables]]. This version is suitable for re-use in other projects, but perhaps should be renamed EventLog or Events because the MySQL syntax highlighter thinks "log" is a keyword.
* '''Version''': Copied, with only slight changes, from the event table in {{l/htyp|VbzCart}} (which later became part of [[Ferreteria]]'s event-logging system which has since been redesigned). <s>This version is suitable for re-use in other projects, but perhaps should be renamed EventLog or Events because the MySQL syntax highlighter thinks "log" is a keyword.</s>
** 2009-08-30: suggest LogEvent ("Log" as prefix so all log tables are together, type of log as singular)
** 2009-08-30: suggest LogEvent ("Log" as prefix so all log tables are together, type of log as singular)
* '''Fields''':
* '''Fields''':
Line 8: Line 8:
** "Code" doesn't seem to be getting any use, but leaving it in for now
** "Code" doesn't seem to be getting any use, but leaving it in for now
* '''History''':
* '''History''':
** '''2010-03-31''' Making changes based on changes to [[VbzCart/tables/event log]], since those seem to be working well:
** '''2010-03-31''' Making changes based on changes to {{l/htyp|VbzCart/tables/event log}}, since those seem to be working well:
*** renaming table: "Event Log" -> "event"
*** renaming table: "Event Log" -> "event"
*** EvWhen -> WhenStarted, WhenFinished
*** EvWhen -> WhenStarted, WhenFinished
*** AppUser -> WhoAdmin, SysUser -> WhoSystem, Machine -> WhoNetwork
*** AppUser -> WhoAdmin, SysUser -> WhoSystem, Machine -> WhoNetwork
==SQL==
==SQL==
<section begin=sql /><mysql>CREATE TABLE `event` (
<source lang=mysql>CREATE TABLE `event` (
     ID INT NOT NULL AUTO_INCREMENT COMMENT "used to track incomplete events; may be renumbered later",
     ID INT NOT NULL AUTO_INCREMENT COMMENT "used to track incomplete events; may be renumbered later",
     WhenStarted  DATETIME        NOT NULL COMMENT "set just before starting the event",
     WhenStarted  DATETIME        NOT NULL COMMENT "set just before starting the event",
Line 30: Line 30:
     Notes        VARCHAR(255) DEFAULT NULL COMMENT "manually-entered notes",
     Notes        VARCHAR(255) DEFAULT NULL COMMENT "manually-entered notes",
     PRIMARY KEY (`ID`)
     PRIMARY KEY (`ID`)
  ) ENGINE = MYISAM;</mysql>
  ) ENGINE = MYISAM;</source>
<section end=sql />

Latest revision as of 14:59, 2 March 2020

About

  • Version: Copied, with only slight changes, from the event table in VbzCart (which later became part of Ferreteria's event-logging system which has since been redesigned). This version is suitable for re-use in other projects, but perhaps should be renamed EventLog or Events because the MySQL syntax highlighter thinks "log" is a keyword.
    • 2009-08-30: suggest LogEvent ("Log" as prefix so all log tables are together, type of log as singular)
  • Fields:
    • isError: FALSE = this is just a message or normal event; TRUE = there is a problem to fix (error)
  • Notes
    • Have to use "Ev" prefix for field names that would otherwise be keywords: When, Where
    • "Code" doesn't seem to be getting any use, but leaving it in for now
  • History:
    • 2010-03-31 Making changes based on changes to VbzCart/tables/event log, since those seem to be working well:
      • renaming table: "Event Log" -> "event"
      • EvWhen -> WhenStarted, WhenFinished
      • AppUser -> WhoAdmin, SysUser -> WhoSystem, Machine -> WhoNetwork

SQL

CREATE TABLE `event` (
    ID INT NOT NULL AUTO_INCREMENT COMMENT "used to track incomplete events; may be renumbered later",
    WhenStarted  DATETIME         NOT NULL COMMENT "set just before starting the event",
    WhenFinished DATETIME     DEFAULT NULL COMMENT "set after completing the event; indicates the code did not crash",
    ModType      VARCHAR(15)  DEFAULT NULL COMMENT "type of modification done by event",
    ModIndex     INT(4)       DEFAULT NULL COMMENT "ID of row being modified by this event",
    EvWhere      VARCHAR(255)     NOT NULL COMMENT "where in the code the event happened (suitable for filtering)",
    Params       VARCHAR(255) DEFAULT NULL COMMENT "any relevant parameters",
    Descr        VARCHAR(255) DEFAULT NULL COMMENT "description of event",
    Code         INT          DEFAULT NULL COMMENT "numeric event code unique to location (EvWhere)",
    WhoAdmin     VARCHAR(127) COMMENT "application username, for when we have a user-security system",
    WhoSystem    VARCHAR(127) COMMENT "who logged into the operating system (username)",
    WhoNetwork   VARCHAR(64)  COMMENT "network name of machine from which the event was initiated, if applicable",
    isError      BOOL         COMMENT "indicates whether event indicates a problem to fix",
    isSevere     BOOL         COMMENT "TRUE = important enough to send email to admin immediately",
    Notes        VARCHAR(255) DEFAULT NULL COMMENT "manually-entered notes",
    PRIMARY KEY (`ID`)
 ) ENGINE = MYISAM;