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
(using new terms template)
(→‎SQL: fixed missing "T" in "NOT"; tidying)
Line 6: Line 6:
 
** '''2011-06-06''' This table may end up not being used, since I've found I can use [[Semantic MediaWiki|SMW]] to store answer data. Also, I'm thinking it should be "choice" rather than "answer", but since it's no longer hard-coded, this is just a matter of updating documentation (and one field name in the  {{l/same|rating}} table.
 
** '''2011-06-06''' This table may end up not being used, since I've found I can use [[Semantic MediaWiki|SMW]] to store answer data. Also, I'm thinking it should be "choice" rather than "answer", but since it's no longer hard-coded, this is just a matter of updating documentation (and one field name in the  {{l/same|rating}} table.
 
==SQL==
 
==SQL==
<section begin=sql /><mysql>CREATE TABLE `answer` (
+
<mysql>CREATE TABLE `answer` (
   `ID` INT NOT NULL AUTO_INCREMENT,
+
   `ID`         INT         NOT NULL AUTO_INCREMENT,
   `ID_Question` INT NO 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",
+
   `Page`       VARCHAR(127)         COMMENT "wiki page describing answer",
   `WhenCreated` DATETIME NOT NULL COMMENT "when this answer was entered",
+
   `WhenCreated` DATETIME     NOT NULL COMMENT "when this answer was entered",
 
   `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)",
Line 16: Line 16:
 
  )
 
  )
 
  ENGINE = MYISAM;</mysql>
 
  ENGINE = MYISAM;</mysql>
<section end=sql />
 

Revision as of 16:22, 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:
    • "WhenExpires" field: same applies as in "question" table.
    • 2011-06-06 This table may end up not being used, since I've found I can use SMW to store answer data. Also, I'm thinking it should be "choice" rather than "answer", but since it's no longer hard-coded, this is just a matter of updating documentation (and one field name in the rating table.

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",
  `Page`        VARCHAR(127)          COMMENT "wiki page describing answer",
  `WhenCreated` DATETIME     NOT NULL COMMENT "when this answer was entered",
  `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)",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>