Difference between revisions of "InstaGov/schema/answer"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
Jump to navigation Jump to search
(extracted obsolete note; clarified note about field removal)
(moar betterer feelds)
Line 4: Line 4:
 
* '''Notes''':
 
* '''Notes''':
 
** This table originally had a "WhenExpires" field; it was removed for the same reasons given in notes for the "{{l/same|question}}" table.
 
** This table originally had a "WhenExpires" field; it was removed for the same reasons given in notes for the "{{l/same|question}}" table.
 +
==History==
 +
* '''2013-01-07''' Added "Summary" field, which I had removed earlier when I was still thinking of letting this be heavily dependent on MW, and who/when fields.
 
==SQL==
 
==SQL==
 
<mysql>CREATE TABLE `answer` (
 
<mysql>CREATE TABLE `answer` (
 
   `ID`          INT          NOT NULL AUTO_INCREMENT,
 
   `ID`          INT          NOT NULL AUTO_INCREMENT,
 
   `ID_Question` INT          NOT NULL COMMENT "question.ID for which this is an answer",
 
   `ID_Question` INT          NOT NULL COMMENT "question.ID for which this is an answer",
   `Page`       VARCHAR(127)         COMMENT "wiki page describing answer",
+
   `Summary` VARCHAR(255)   NOT NULL COMMENT "short description of answer",
   `WhenCreated` DATETIME     NOT NULL COMMENT "when this answer was entered",
+
   `Page`    VARCHAR(127)            COMMENT "URI of optional site page giving more details",
 
   `Pos_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'yes' end of the scale (overrides question default)",
 
   `Pos_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'yes' end of the scale (overrides question default)",
 
   `Neg_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'no' end of the scale (overrides question default)",
 
   `Neg_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'no' end of the scale (overrides question default)",
 +
  `WhenCreated` DATETIME    NOT NULL COMMENT "when this records was entered",
 +
  `WhoCreated`  INT          NOT NULL COMMENT "ID of user who added the record",
 +
  `WhenEdited`  DATETIME DEFAULT NULL COMMENT "when this question was last edited",
 +
  `WhoEdited`  INT      DEFAULT NULL COMMENT "ID of user who last edited the record",
 +
  `QtyEdits`    INT      DEFAULT NULL COMMENT "number of times this record has been edited",
 
   PRIMARY KEY(`ID`)
 
   PRIMARY KEY(`ID`)
 
  )
 
  )
 
  ENGINE = MYISAM;</mysql>
 
  ENGINE = MYISAM;</mysql>

Revision as of 18:00, 7 January 2013

About

  • Purpose: implements answers
  • Rules: Any question may have zero or more answers. New answers can be added at any time.
  • Notes:
    • This table originally had a "WhenExpires" field; it was removed for the same reasons given in notes for the "question" table.

History

  • 2013-01-07 Added "Summary" field, which I had removed earlier when I was still thinking of letting this be heavily dependent on MW, and who/when fields.

SQL

<mysql>CREATE TABLE `answer` (

  `ID`          INT          NOT NULL AUTO_INCREMENT,
  `ID_Question` INT          NOT NULL COMMENT "question.ID for which this is an answer",
  `Summary`  VARCHAR(255)    NOT NULL COMMENT "short description of answer",
  `Page`     VARCHAR(127)             COMMENT "URI of optional site page giving more details",
  `Pos_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'yes' end of the scale (overrides question default)",
  `Neg_Text` VARCHAR(63) DEFAULT NULL COMMENT "optional: text to show at the 'no' end of the scale (overrides question default)",
  `WhenCreated` DATETIME     NOT NULL COMMENT "when this records was entered",
  `WhoCreated`  INT          NOT NULL COMMENT "ID of user who added the record",
  `WhenEdited`  DATETIME DEFAULT NULL COMMENT "when this question was last edited",
  `WhoEdited`   INT      DEFAULT NULL COMMENT "ID of user who last edited the record",
  `QtyEdits`    INT      DEFAULT NULL COMMENT "number of times this record has been edited",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>