Ferreteria/sql/event done

From Woozle Writes Code
Jump to navigation Jump to search

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;