Ferreteria/sql/event in table: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with "==About== * '''Purpose''': dependent table for logging table-related events * '''Depends on''': {{l/same|event}} ==History== * '''2017-05-06''' Adapting the good bits from V...")
 
No edit summary
Line 7: Line 7:
<mysql>CREATE TABLE `event_in_table` (
<mysql>CREATE TABLE `event_in_table` (
     ID_Event    INT              NOT NULL COMMENT "event.ID of parent event",
     ID_Event    INT              NOT NULL COMMENT "event.ID of parent event",
    Code        VARCHAR(7)  DEFAULT NULL COMMENT "mnemonic event code unique within table type (ModType)",
     WhatSQL    TEXT        DEFAULT NULL COMMENT "any SQL executed for this event",
     WhatSQL    TEXT        DEFAULT NULL COMMENT "any SQL executed for this event",
     TableKey    VARCHAR(15)      NOT NULL COMMENT "action key of table affected",
     TableKey    VARCHAR(15)      NOT NULL COMMENT "action key of table affected",
     TableRow    INT(4)      DEFAULT NULL COMMENT "ID of row (if any) being modified by this event",
     TableRow    INT(4)      DEFAULT NULL COMMENT "ID of row (if any) being modified by this event",
     Code        VARCHAR(7)  DEFAULT NULL COMMENT "mnemonic event code unique within table type (ModType)",
     OldData    TEXT        DEFAULT NULL COMMENT "data row values before change",
    ChgData    TEXT        DEFAULT NULL COMMENT "changed data fields",
    NewData    TEXT        DEFAULT NULL COMMENT "data row values after change",
     PRIMARY KEY (`ID_Event`)
     PRIMARY KEY (`ID_Event`)
  ) ENGINE = InnoDB;</mysql>
  ) ENGINE = InnoDB;</mysql>

Revision as of 19:47, 6 February 2017

About

  • Purpose: dependent table for logging table-related events
  • Depends on: event

History

SQL

<mysql>CREATE TABLE `event_in_table` (

   ID_Event    INT              NOT NULL COMMENT "event.ID of parent event",
   Code        VARCHAR(7)   DEFAULT NULL COMMENT "mnemonic event code unique within table type (ModType)",
   WhatSQL     TEXT         DEFAULT NULL COMMENT "any SQL executed for this event",
   TableKey    VARCHAR(15)      NOT NULL COMMENT "action key of table affected",
   TableRow    INT(4)       DEFAULT NULL COMMENT "ID of row (if any) being modified by this event",
   OldData     TEXT         DEFAULT NULL COMMENT "data row values before change",
   ChgData     TEXT         DEFAULT NULL COMMENT "changed data fields",
   NewData     TEXT         DEFAULT NULL COMMENT "data row values after change",
   PRIMARY KEY (`ID_Event`)
) ENGINE = InnoDB;</mysql>