SpamFerret/tables/pattern log

About

 * Rules:
 * adding a new pattern:
 * if new pattern not in archive, add an entry for it
 * log event: ID_Old=NULL, ID_New= new pattern
 * add the pattern record to
 * modifying a pattern:
 * if old pattern not in archive, add an entry for it
 * if new pattern not in archive, add an entry for it
 * log event: ID_Old= old pattern, ID_New= new pattern
 * modify the record in and increment count in archive
 * retiring a pattern:
 * if old pattern not in archive, add an entry for it
 * log event: ID_Old= old pattern, ID_New = NULL
 * delete the record in and increment count in archive
 * History:
 * 2009-08-05 Created for Special:SpamFerret

SQL
CREATE TABLE `pattern_log` ( `ID`            INT         NOT NULL AUTO_INCREMENT,  `ID_Pattern`    INT         NOT NULL COMMENT "patterns.ID of pattern being altered",  `ID_Old`        INT     DEFAULT NULL COMMENT "pattern_archive.ID of old value of pattern being edited",  `ID_New`        INT     DEFAULT NULL COMMENT "pattern_archive.ID of new value of pattern being edited",  `UserName` VARCHAR(255)     NOT NULL COMMENT "username of administrator who made this pattern change",  `UserSite` VARCHAR(63)  DEFAULT NULL COMMENT "identifier of site from which pattern is being changed (optional)",  `Notes`    VARCHAR(255) DEFAULT NULL COMMENT "human-entered notes explaining reason for change (optional)",  PRIMARY KEY(`ID`) )ENGINE = MYISAM;