Ferreteria/sql/event in table: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
m (6 revisions imported: moving this project here)
 
(One intermediate revision by one other user not shown)
Line 4: Line 4:
==History==
==History==
* '''2017-02-06''' Adapting the good bits from [[VbzCart/tables/event log]]
* '''2017-02-06''' Adapting the good bits from [[VbzCart/tables/event log]]
* '''2017-04-10''' Realized that the row index (TableRow) could be a string. It will be a string in multikey tables even if the keys are integers.
==SQL==
==SQL==
<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",
     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    VARCHAR(255) DEFAULT NULL COMMENT "ID of row (if any) being modified by this event",
     PRIMARY KEY (`ID_Event`)
     PRIMARY KEY (`ID_Event`)
  ) ENGINE = InnoDB;</mysql>
  ) ENGINE = InnoDB;</mysql>

Latest revision as of 16:42, 22 May 2022

About

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

History

  • 2017-02-06 Adapting the good bits from VbzCart/tables/event log
  • 2017-04-10 Realized that the row index (TableRow) could be a string. It will be a string in multikey tables even if the keys are integers.

SQL

<mysql>CREATE TABLE `event_in_table` (

   ID_Event    INT              NOT NULL COMMENT "event.ID of parent event",
   TableKey    VARCHAR(15)      NOT NULL COMMENT "action key of table affected",
   TableRow    VARCHAR(255) DEFAULT NULL COMMENT "ID of row (if any) being modified by this event",
   PRIMARY KEY (`ID_Event`)
) ENGINE = InnoDB;</mysql>