Ferreteria/sql/event done: Difference between revisions
< Ferreteria | sql
Jump to navigation
Jump to search
(some changes) |
m (format updating) |
||
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 | ** "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 | * '''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 | ** ...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;</ | ) ENGINE = InnoDB;</source> |
Revision as of 13:05, 21 February 2018
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 usingState
instead.
- 2017-03-19 Decided many-to-one was a bad idea, given current class design. Removed
ID
and madeID_Event
the primary key again. - 2017-03-28 Decided it makes more sense to change
State
, an integer, toStateCode
, 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.
- ...and also let's have an optional
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;