InstaGov/schema/edit log

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< InstaGov‎ | schema
Revision as of 02:55, 29 December 2012 by Woozle (talk | contribs) (Created page with "==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 th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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:
    • Table: name of the table whose modification is being recorded. If table names are ever changed, data in this field should be updated too (if schema remains compatible).
    • Field: name of field whose modification is being recorded; same note applies as for Table.
    • ValOld: the value before the edit
    • ValNew: the value after the edit

SQL

<mysql>CREATE TABLE `edit_log` (

  `ID`      INT          NOT NULL AUTO_INCREMENT,
  `Table`   VARCHAR(15)  NOT NULL COMMENT "name of table being modified",
  `Field`   VARCHAR(15)  NOT NULL COMMENT "name of field being modified",
  `ValOld`  VARCHAR(255) NOT NULL COMMENT "value before edit",
  `ValNew`  VARCHAR(255) NOT NULL COMMENT "value after edit",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;