Difference between revisions of "InstaGov/schema/rating"
Jump to navigation
Jump to search
m (using new terms template) |
(clearer explanation) |
||
Line 1: | Line 1: | ||
==About== | ==About== | ||
− | * '''Purpose''': | + | * '''Purpose''': Records the current value of one user's {{igov/term|rating}} of a given {{igov/term|answer}} (which in turn is tied to a specific {{igov/term|question}}. These are the values which are aggregated to calculate the voting results for each question. |
* '''Rules''': | * '''Rules''': | ||
** Any {{l/same|answer}} may have zero or more ratings. | ** Any {{l/same|answer}} may have zero or more ratings. | ||
** Each user sets the value of their rating for each answer, and can change that rating at any time. | ** Each user sets the value of their rating for each answer, and can change that rating at any time. | ||
** Changes to ratings are logged in the {{l/same|rating log}}. | ** Changes to ratings are logged in the {{l/same|rating log}}. | ||
− | * | + | ==History== |
+ | * '''2013-01-09''' Removed the "ID_Proxy" field; see {{l/same|rating_log}} for explanation. | ||
==SQL== | ==SQL== | ||
<mysql>CREATE TABLE `rating` ( | <mysql>CREATE TABLE `rating` ( | ||
Line 12: | Line 13: | ||
`ID_Answer` INT NOT NULL COMMENT "answer.ID for which this is a rating", | `ID_Answer` INT NOT NULL COMMENT "answer.ID for which this is a rating", | ||
`ID_Log` INT NOT NULL COMMENT "ID of log event which posted this value", | `ID_Log` INT NOT NULL COMMENT "ID of log event which posted this value", | ||
− | |||
`Value` INT NOT NULL COMMENT "rating value", | `Value` INT NOT NULL COMMENT "rating value", | ||
`WhenDone` DATETIME NOT NULL COMMENT "when this rating was posted", | `WhenDone` DATETIME NOT NULL COMMENT "when this rating was posted", |
Revision as of 16:04, 9 January 2013
About
- Purpose: Records the current value of one user's rating of a given answer (which in turn is tied to a specific question. These are the values which are aggregated to calculate the voting results for each question.
- Rules:
- Any answer may have zero or more ratings.
- Each user sets the value of their rating for each answer, and can change that rating at any time.
- Changes to ratings are logged in the rating log.
History
- 2013-01-09 Removed the "ID_Proxy" field; see rating_log for explanation.
SQL
<mysql>CREATE TABLE `rating` (
`ID` INT NOT NULL AUTO_INCREMENT, `ID_User` INT COMMENT "user.ID who gave this rating", `ID_Answer` INT NOT NULL COMMENT "answer.ID for which this is a rating", `ID_Log` INT NOT NULL COMMENT "ID of log event which posted this value", `Value` INT NOT NULL COMMENT "rating value", `WhenDone` DATETIME NOT NULL COMMENT "when this rating was posted", `Remark` VARCHAR(255) COMMENT "comments on this rating (can include link)", PRIMARY KEY(`ID`) ) ENGINE = MYISAM;</mysql>