Ferreteria/sql/event done: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
mNo edit summary
(SQL tweaks)
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-02-12'''
** Corrected table name in SQL
** Decided that there might be more than one of these per EventPlex, so let's have an ID too and make that the primary key.
** "Condition" is apparently a reserved word and "Status" is apparently a keyword, so using "State" instead.
==SQL==
==SQL==
<mysql>CREATE TABLE `event_log` (
<mysql>CREATE TABLE `event_done` (
    ID              INT NOT NULL AUTO_INCREMENT,
     ID_Event        INT NOT NULL COMMENT "event.ID of parent event",
     ID_Event        INT NOT NULL COMMENT "event.ID of parent event",
     WhenFinish DATETIME NOT NULL COMMENT "when the event completed",
     WhenFinish DATETIME NOT NULL COMMENT "when the event completed",
     Condition  INT  DEFAULT NULL COMMENT "condition code defined by application (success, error, etc.)",
     State      INT  DEFAULT NULL COMMENT "status code defined by application (success, error, etc.)",
     Descrip    TEXT DEFAULT NULL COMMENT "description of completion",
     Descrip    TEXT DEFAULT NULL COMMENT "description of completion",
   PRIMARY KEY (`ID_Event`)
   PRIMARY KEY (`ID`)
) ENGINE = InnoDB;</mysql>
) ENGINE = InnoDB;</mysql>

Revision as of 10:09, 12 February 2017

About

  • Purpose: dependent table for logging event completion
  • Depends on: event

History

  • 2017-02-06 Adapting the good bits from VbzCart/tables/event log
  • 2017-02-12
    • Corrected table name in SQL
    • Decided that there might be more than one of these per EventPlex, so let's have an ID too and make that the primary key.
    • "Condition" is apparently a reserved word and "Status" is apparently a keyword, so using "State" instead.

SQL

<mysql>CREATE TABLE `event_done` (

   ID              INT NOT NULL AUTO_INCREMENT,
   ID_Event        INT NOT NULL COMMENT "event.ID of parent event",
   WhenFinish DATETIME NOT NULL COMMENT "when the event completed",
   State      INT  DEFAULT NULL COMMENT "status code defined by application (success, error, etc.)",
   Descrip    TEXT DEFAULT NULL COMMENT "description of completion",
 PRIMARY KEY (`ID`)

) ENGINE = InnoDB;</mysql>