InstaGov/schema/edit log
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;