Ferreteria/sql/event done: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(some changes)
m (6 revisions imported: moving this project here)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:
** Corrected table name in SQL
** 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.
** 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 <code>Status</code> is apparently a keyword, so using <code>State</code> 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.
* '''2017-03-19''' Decided many-to-one was a bad idea, given current class design. Removed <code>ID</code> and made <code>ID_Event</code> the primary key again.
* '''2017-03-28''' Decided it makes more sense to change "State", an integer, to "StateCode", a string, as in the base event table. And make it NOT NULL.
* '''2017-03-28''' Decided it makes more sense to change <code>State</code>, an integer, to <code>StateCode</code>, a string, as in the base event table. And make it NOT NULL.
** ...and also let's have a Stash, as in the base, which could be especially useful for diagnosing error conditions.
** ...and also let's have an optional <code>Stash</code>, as in the base, which could be especially useful for diagnosing error conditions.
==SQL==
==SQL==
<mysql>CREATE TABLE `event_done` (
<source lang=mysql>CREATE TABLE `event_done` (
     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",
Line 19: Line 19:
     Stash          TEXT DEFAULT NULL COMMENT "additional event-related data that doesn't need to be searchable",
     Stash          TEXT DEFAULT NULL COMMENT "additional event-related data that doesn't need to be searchable",
   PRIMARY KEY (`ID_Event`)
   PRIMARY KEY (`ID_Event`)
) ENGINE = InnoDB;</mysql>
) ENGINE = InnoDB;</source>

Latest revision as of 16:42, 22 May 2022

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.
  • 2017-03-28 Decided it makes more sense to change State, an integer, to StateCode, a string, as in the base event table. And make it NOT NULL.
    • ...and also let's have an optional Stash, as in the base, which could be especially useful for diagnosing error conditions.

SQL

CREATE TABLE `event_done` (
    ID_Event            INT NOT NULL COMMENT "event.ID of parent event",
    WhenFinish     DATETIME NOT NULL COMMENT "when the event completed",
    StateCode  VARCHAR(255) NOT NULL COMMENT "status code defined by application (success, error, etc.)",
    Descrip        TEXT DEFAULT NULL COMMENT "description of completion",
    Stash          TEXT DEFAULT NULL COMMENT "additional event-related data that doesn't need to be searchable",
  PRIMARY KEY (`ID_Event`)
) ENGINE = InnoDB;