MWX/SpamFerret/tables/patterns: Difference between revisions

From Woozle Writes Code
< MWX‎ | SpamFerret‎ | tables
Jump to navigation Jump to search
(+ID_Archive)
(10/6 "Notes" field)
Line 3: Line 3:
** '''2009-07-14''' Adding attempts.diff and patterns.isDiff to enable more advanced filtering (e.g. bots which delete most of a section and replace it with a nonsense word)
** '''2009-07-14''' Adding attempts.diff and patterns.isDiff to enable more advanced filtering (e.g. bots which delete most of a section and replace it with a nonsense word)
** '''2009-08-05''' Adding ID_Archive field (part of new pattern maintenance system)
** '''2009-08-05''' Adding ID_Archive field (part of new pattern maintenance system)
** '''2009-10-06''' Adding Notes field (need to be able to make notes on a pattern's intent)
==SQL==
==SQL==
<mysql>CREATE TABLE `patterns` (
<mysql>CREATE TABLE `patterns` (
   `ID` INT NOT NULL AUTO_INCREMENT,
   `ID` INT NOT NULL AUTO_INCREMENT,
   `Pattern` varchar(255) COMMENT "pattern to match (regex or straight text match)",
   `Pattern`   VARCHAR(255)             COMMENT "pattern to match (regex or straight text match)",
   `ID_Archive` INT NOT NULL COMMENT "pattern_archive.ID of source for this pattern",
   `ID_Archive` INT         NOT NULL   COMMENT "pattern_archive.ID of source for this pattern",
   `WhenAdded` DATETIME DEFAULT NULL COMMENT "when this entry was added",
   `WhenAdded` DATETIME   DEFAULT NULL COMMENT "when this entry was added",
   `WhenTried` DATETIME DEFAULT NULL COMMENT "when a spammer last attempted to include this pattern",
   `WhenTried` DATETIME   DEFAULT NULL COMMENT "when a spammer last attempted to include this pattern",
   `isActive`  TINYINT(1) COMMENT "FALSE = do not include in checking",
   `isActive`  TINYINT(1)               COMMENT "FALSE = do not include in checking",
   `isURL`    TINYINT(1) COMMENT "TRUE indicates that additional URL-related stats may be collected",
   `isURL`    TINYINT(1)               COMMENT "TRUE indicates that additional URL-related stats may be collected",
   `isRegex`  TINYINT(1) COMMENT "TRUE = regex (use preg_match()); FALSE = normal string comparison (use stristr())",
   `isRegex`  TINYINT(1)               COMMENT "TRUE = regex (use preg_match()); FALSE = normal string comparison (use stristr())",
   `isDiff`    TINYINT(1) DEFAULT FALSE COMMENT "TRUE = pattern should be compared to the diff, not the edit contents",
   `isDiff`    TINYINT(1) DEFAULT FALSE COMMENT "TRUE = pattern should be compared to the diff, not the edit contents",
   `Count` INT DEFAULT 0 COMMENT "number of attempts",
   `Count`     INT       DEFAULT 0     COMMENT "number of attempts",
  `Notes`  VARCHAR(255) DEFAULT NULL  COMMENT "human-added notes",
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = MYISAM;</mysql>

Revision as of 12:17, 6 October 2009

About

  • History:
    • 2009-07-14 Adding attempts.diff and patterns.isDiff to enable more advanced filtering (e.g. bots which delete most of a section and replace it with a nonsense word)
    • 2009-08-05 Adding ID_Archive field (part of new pattern maintenance system)
    • 2009-10-06 Adding Notes field (need to be able to make notes on a pattern's intent)

SQL

<mysql>CREATE TABLE `patterns` (

 `ID` INT NOT NULL AUTO_INCREMENT,
 `Pattern`   VARCHAR(255)             COMMENT "pattern to match (regex or straight text match)",
 `ID_Archive` INT         NOT NULL    COMMENT "pattern_archive.ID of source for this pattern",
 `WhenAdded` DATETIME   DEFAULT NULL  COMMENT "when this entry was added",
 `WhenTried` DATETIME   DEFAULT NULL  COMMENT "when a spammer last attempted to include this pattern",
 `isActive`  TINYINT(1)               COMMENT "FALSE = do not include in checking",
 `isURL`     TINYINT(1)               COMMENT "TRUE indicates that additional URL-related stats may be collected",
 `isRegex`   TINYINT(1)               COMMENT "TRUE = regex (use preg_match()); FALSE = normal string comparison (use stristr())",
 `isDiff`    TINYINT(1) DEFAULT FALSE COMMENT "TRUE = pattern should be compared to the diff, not the edit contents",
 `Count`     INT        DEFAULT 0     COMMENT "number of attempts",
 `Notes`   VARCHAR(255) DEFAULT NULL  COMMENT "human-added notes",
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>