Ferret File System/v0.1/SQL/event: Difference between revisions
< Ferret File System | v0.1 | SQL
Jump to navigation
Jump to search
m (Woozle moved page FileFerret/SQL/events to FileFerret/SQL/event without leaving a redirect) |
m (Woozle moved page FileFerret/SQL/event to Ferret File System/v0.1/SQL/event: obsolete) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* '''purpose''': root events table -- all task-specific events tables refer to this one | * '''purpose''': root events table -- all task-specific events tables refer to this one | ||
===fields=== | ===fields=== | ||
* '''ID_Client''': ID of {{l/same|client}} that generated the event | |||
* '''When''': When the event occurred. | * '''When''': When the event occurred. | ||
** If an event-type has a beginning and end, the auxiliary table for that type may treat '''When''' as "when started" and add a WhenComplete field to indicate when the event was complete. | ** If an event-type has a beginning and end, the auxiliary table for that type may treat '''When''' as "when started" and add a WhenComplete field to indicate when the event was complete. | ||
Line 12: | Line 13: | ||
<mysql>CREATE TABLE `event` ( | <mysql>CREATE TABLE `event` ( | ||
`ID` INT NOT NULL AUTO_INCREMENT, | `ID` INT NOT NULL AUTO_INCREMENT, | ||
`ID_Client` INT NOT NULL, | |||
`When` DATETIME NOT NULL, | `When` DATETIME NOT NULL, | ||
`Type` VARCHAR(15) | `Type` VARCHAR(15) NOT NULL, | ||
`Code` VARCHAR(15) NOT NULL, | |||
`What` VARCHAR(255) DEFAULT NULL, | `What` VARCHAR(255) DEFAULT NULL, | ||
PRIMARY KEY(`ID`) | PRIMARY KEY(`ID`), | ||
UNIQUE KEY(`Type`,`Code`) | |||
) | ) | ||
ENGINE = | ENGINE = INNODB;</mysql> |
Latest revision as of 13:40, 25 February 2024
About
- purpose: root events table -- all task-specific events tables refer to this one
fields
- ID_Client: ID of client that generated the event
- When: When the event occurred.
- If an event-type has a beginning and end, the auxiliary table for that type may treat When as "when started" and add a WhenComplete field to indicate when the event was complete.
- Type: short string indicating which type of event, i.e. which class to use (and which auxiliary event table to look at).
- What: automatically-generated human-friendly description of what happened
history
- 2016-02-27 started
SQL
<mysql>CREATE TABLE `event` (
`ID` INT NOT NULL AUTO_INCREMENT, `ID_Client` INT NOT NULL, `When` DATETIME NOT NULL, `Type` VARCHAR(15) NOT NULL, `Code` VARCHAR(15) NOT NULL, `What` VARCHAR(255) DEFAULT NULL, PRIMARY KEY(`ID`), UNIQUE KEY(`Type`,`Code`)
) ENGINE = INNODB;</mysql>