InstaGov/schema/edit log

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Revision as of 23:30, 3 January 2013 by Woozle (talk | contribs) (convention-compatibility with clsLogger_DataSet)

About

  • Purpose: Maintains an edit history of changes to everything except ratings, i.e. things which shouldn't be edited very much to begin with. The size of this table should be kept to a minimum by recording only changes to existing records, not their initial creation.

Fields

  • ModType: action key of the table whose modification is being recorded.
  • ModIndex: value of primary key (typically "ID") for record being modified

History

  • 2013-01-03
    • added "WhenStarted", "WhenFinished", "ID_User"
    • "Table"->"ModType" and "ID_Rec"->"ModIndex" for convention-compatibility with clsLogger_DataSet (events.php; see VbzCart/tables/event_log for existing table), although I'm writing a new class to handle logging to this table
    • "Field", "ValOld", and "ValNew" moved to edit_log_field

SQL

<mysql>CREATE TABLE `edit_log` (

  `ID`           INT          NOT NULL AUTO_INCREMENT,
  `ModType`      VARCHAR(15)  NOT NULL COMMENT "action key of table being modified",
  `ModIndex`     INT          NOT NULL COMMENT "primary key value of record being modified",
  `WhenStarted`  DATETIME     NOT NULL COMMENT "when the save was attempted",
  `WhenFinished` DATETIME DEFAULT NULL COMMENT "when the save was successfully completed",
  `ID_User`      INT          NOT NULL COMMENT "numerical ID of user who made the edit",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>