Ferreteria/v0.41/log

From Woozle Writes Code
Jump to navigation Jump to search

The event-logging system uses the object-data system, including the table structure (under different names). Schema documentation here will be kept separate in case of tweaks, and to make it easier to construct the tables.

Tentatively, the "log.Type" field will be slightly repurposed from its usage in node.

Tables

log

Documentation: Template:L/version

CREATE TABLE `log` (
  `ID`       INT(4)       NOT NULL AUTO_INCREMENT,
  `Type`     VARCHAR(255) NOT NULL COMMENT "name of node type",
  `WhenMade` DATETIME     NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY(`ID`)
) ENGINE=InnoDB;

log_leaf

Documentation: Template:L/version

CREATE TABLE `log_leaf` (
  `ID`      INT(4)        NOT NULL AUTO_INCREMENT,
  `ID_Node` INT(4)        NOT NULL COMMENT "ID of log node to which this value belongs",
  `Name`    VARCHAR(255)  NOT NULL COMMENT "internal name of this value",
  `Type`    VARCHAR(255)  NOT NULL COMMENT "name of leaf (field) type",
  PRIMARY KEY(`ID`),
  UNIQUE KEY(`ID_Node`,`Name`)
) ENGINE=InnoDB;

log_leaf_text

Documentation: Template:L/version

CREATE TABLE  `log_leaf_text` (
  `ID_Leaf` INT(4)        NOT NULL COMMENT "ID of leaf to which this value belongs",
  `Value`   TEXT      DEFAULT NULL COMMENT "the value",
  PRIMARY KEY(`ID_Leaf`)
) ENGINE=InnoDB;

log_leaf_time

Documentation: Template:L/version

CREATE TABLE  `log_leaf_time` (
  `ID_Leaf` INT(4)        NOT NULL COMMENT "ID of leaf to which this value belongs",
  `Value`   DATETIME      DEFAULT NULL COMMENT "the value",
  PRIMARY KEY(`ID_Leaf`)
) ENGINE=InnoDB;

log_leaf_int

Documentation: Template:L/version

CREATE TABLE  `log_leaf_int` (
  `ID_Leaf` INT(4)      NOT NULL COMMENT "ID of leaf to which this value belongs",
  `Value`   BIGINT      DEFAULT NULL COMMENT "the value",
  PRIMARY KEY(`ID_Leaf`)
) ENGINE=InnoDB;