Difference between revisions of "InstaGov/schema/question"

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
(link to concept page)
(→‎History: condensation & clarity)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==About==
 
==About==
* '''Purpose''': implements {{instagov|concepts|question}}s
+
* '''Purpose''': implements {{igov/term|question}}s
 
* '''Notes''':
 
* '''Notes''':
 
** I originally had a "WhenExpires" field as a way of making a decision at a specific time, but I decided that this belongs in a separate table (something like "decision point"). Timetable functionality feels "tacked-on", and putting it in a separate table allows keeping that feature from becoming entangled with basic voting. We might want to be able to implement, say, more than one decision-point per question.
 
** I originally had a "WhenExpires" field as a way of making a decision at a specific time, but I decided that this belongs in a separate table (something like "decision point"). Timetable functionality feels "tacked-on", and putting it in a separate table allows keeping that feature from becoming entangled with basic voting. We might want to be able to implement, say, more than one decision-point per question.
 
** Not sure if we'll actually need Pos/Neg_Text; it may be just a frill.
 
** Not sure if we'll actually need Pos/Neg_Text; it may be just a frill.
** '''2011-05-02''' This entire table may be redundant. Current thinking:
+
** '''2011-05-02''' Makes no sense to have Pos/Neg Text; that's an Answer thing. (See [[InstaGov/SMW/questions]] for obsolete notes.)
*** Each question is a wiki page, marked with a predetermined category.
 
*** This makes the list of questions queryable through the category table.
 
*** Use [[W3TPL]] to define display text, using <let name=text>text to display</let>.
 
*** Maybe we need a way for W3TPL to store <let> data, to make it more searchable -- but that can happen later.
 
*** (Or maybe, given the simplicity of Question data, we just use <noinclude> to delineate text which should not be shown in question lists. For now, sticking with W3TPL.)
 
*** Makes no sense to have Pos/Neg Text; that's an Answer thing.
 
 
** '''2012-12-28''' Making the structure dependent on wiki pages increases platform-dependency and CPU overhead. Keep the table, make wiki page optional (it should default, at page creation time, to a calculated name which can be updated if the page is moved). We will probably need a log of edits to Answers. In fact, let's do a [[../edit_log|general log]].
 
** '''2012-12-28''' Making the structure dependent on wiki pages increases platform-dependency and CPU overhead. Keep the table, make wiki page optional (it should default, at page creation time, to a calculated name which can be updated if the page is moved). We will probably need a log of edits to Answers. In fact, let's do a [[../edit_log|general log]].
 
===History===
 
===History===
 
* '''2012-12-28''' Removing *_Text; adding Summary, WhoCreated
 
* '''2012-12-28''' Removing *_Text; adding Summary, WhoCreated
 +
* '''2013-01-03''' changed WhoCreated and WhoEdited from string to integer
 +
* '''2013-01-07''' Added UNIQUE KEY for Summary
 +
* '''2013-07-14''' Revising to use {{l/pferret}}
 +
** Removing fields duplicated in parent tables: '''Summary''', '''Page''' ({{l/pferret/sql|post}}), '''WhenCreated''', '''WhoCreated''', '''WhenEdited''', '''WhoEdited''', '''QtyEdits''' ({{l/pferret/sql|atom}})
 +
** Alternatively, we could have eliminated this table altogether and used the {{l/pferret/sql|post}} table instead by adding a "class" field (to distinguish between "questions" and other types of posts), since this record now adds no other information, but we may later want to add some fields specific to the "question" class... and so far none of the other post-derivatives are capable of being this stripped-down, so the "class" field would be redundant for them.
 +
 
==SQL==
 
==SQL==
 +
<mysql>CREATE TABLE `question` (
 +
  `ID_Post`    INT              NOT NULL COMMENT "post.ID for content",
 +
  PRIMARY KEY(`ID_Post`)
 +
)
 +
ENGINE = MYISAM;</mysql>
 +
==Obsolete==
 
<mysql>CREATE TABLE `question` (
 
<mysql>CREATE TABLE `question` (
 
   `ID` INT  NOT NULL AUTO_INCREMENT,
 
   `ID` INT  NOT NULL AUTO_INCREMENT,
Line 20: Line 26:
 
   `Page`        VARCHAR(127) DEFAULT NULL COMMENT "optional wiki page with more information",
 
   `Page`        VARCHAR(127) DEFAULT NULL COMMENT "optional wiki page with more information",
 
   `WhenCreated` DATETIME        NOT NULL COMMENT "when this question was entered",
 
   `WhenCreated` DATETIME        NOT NULL COMMENT "when this question was entered",
   `WhoCreated`  VARCHAR(127)    NOT NULL COMMENT "username of user who added the question",
+
   `WhoCreated`  INT              NOT NULL COMMENT "ID of user who added the question",
 
   `WhenEdited`  DATETIME    DEFAULT NULL COMMENT "when this question was last edited",
 
   `WhenEdited`  DATETIME    DEFAULT NULL COMMENT "when this question was last edited",
   `WhoEdited`  VARCHAR(127) DEFAULT NULL COMMENT "username of user who last edited the question",
+
   `WhoEdited`  INT          DEFAULT NULL COMMENT "ID of user who last edited the question",
 
   `QtyEdits`    INT          DEFAULT NULL COMMENT "number of times this question has been edited",
 
   `QtyEdits`    INT          DEFAULT NULL COMMENT "number of times this question has been edited",
   PRIMARY KEY(`ID`)
+
   PRIMARY KEY(`ID`),
 +
  UNIQUE KEY `content` (`Summary`)
 
  )
 
  )
 
  ENGINE = MYISAM;</mysql>
 
  ENGINE = MYISAM;</mysql>

Latest revision as of 16:32, 14 July 2013

About

  • Purpose: implements questions
  • Notes:
    • I originally had a "WhenExpires" field as a way of making a decision at a specific time, but I decided that this belongs in a separate table (something like "decision point"). Timetable functionality feels "tacked-on", and putting it in a separate table allows keeping that feature from becoming entangled with basic voting. We might want to be able to implement, say, more than one decision-point per question.
    • Not sure if we'll actually need Pos/Neg_Text; it may be just a frill.
    • 2011-05-02 Makes no sense to have Pos/Neg Text; that's an Answer thing. (See InstaGov/SMW/questions for obsolete notes.)
    • 2012-12-28 Making the structure dependent on wiki pages increases platform-dependency and CPU overhead. Keep the table, make wiki page optional (it should default, at page creation time, to a calculated name which can be updated if the page is moved). We will probably need a log of edits to Answers. In fact, let's do a general log.

History

  • 2012-12-28 Removing *_Text; adding Summary, WhoCreated
  • 2013-01-03 changed WhoCreated and WhoEdited from string to integer
  • 2013-01-07 Added UNIQUE KEY for Summary
  • 2013-07-14 Revising to use PostFerret
    • Removing fields duplicated in parent tables: Summary, Page (post), WhenCreated, WhoCreated, WhenEdited, WhoEdited, QtyEdits (atom)
    • Alternatively, we could have eliminated this table altogether and used the post table instead by adding a "class" field (to distinguish between "questions" and other types of posts), since this record now adds no other information, but we may later want to add some fields specific to the "question" class... and so far none of the other post-derivatives are capable of being this stripped-down, so the "class" field would be redundant for them.

SQL

<mysql>CREATE TABLE `question` (

  `ID_Post`     INT              NOT NULL COMMENT "post.ID for content",
  PRIMARY KEY(`ID_Post`)
)
ENGINE = MYISAM;</mysql>

Obsolete

<mysql>CREATE TABLE `question` (

  `ID` INT  NOT NULL AUTO_INCREMENT,
  `Summary`     VARCHAR(255)     NOT NULL COMMENT "short description of question",
  `Page`        VARCHAR(127) DEFAULT NULL COMMENT "optional wiki page with more information",
  `WhenCreated` DATETIME         NOT NULL COMMENT "when this question was entered",
  `WhoCreated`  INT              NOT NULL COMMENT "ID of user who added the question",
  `WhenEdited`  DATETIME     DEFAULT NULL COMMENT "when this question was last edited",
  `WhoEdited`   INT          DEFAULT NULL COMMENT "ID of user who last edited the question",
  `QtyEdits`    INT          DEFAULT NULL COMMENT "number of times this question has been edited",
  PRIMARY KEY(`ID`),
  UNIQUE KEY `content` (`Summary`)
)
ENGINE = MYISAM;</mysql>