Ferreteria/sql/event done: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(SQL tweaks)
No edit summary
Line 8: Line 8:
** 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.
** 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.
** "Condition" is apparently a reserved word and "Status" is apparently a keyword, so using "State" instead.
* '''2017-03-19''' Decided many-to-one was a bad idea, given current class design. Removed ID and made ID_Event the primary key again.
==SQL==
==SQL==
<mysql>CREATE TABLE `event_done` (
<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",
     State      INT  DEFAULT NULL COMMENT "status 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`)
   PRIMARY KEY (`ID_Event`)
) ENGINE = InnoDB;</mysql>
) ENGINE = InnoDB;</mysql>

Revision as of 12:17, 19 March 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.
  • 2017-03-19 Decided many-to-one was a bad idea, given current class design. Removed ID and made ID_Event the primary key again.

SQL

<mysql>CREATE TABLE `event_done` (

   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_Event`)

) ENGINE = InnoDB;</mysql>