mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-24 06:20:56 +01:00
64472dd7b8
Summary: Ponder is similar in spirit to the Wiki tool, but uses a Q&A format and up/downvotes to signal user sentiment. Popular questions are moved to the top of the feed on a 5-minute cycle based on age (younger is better) and vote count (higher is better). Pre-apologies for noob diff. Test Plan: - `./bin/phd list` Should include `PonderHeatDaemon`; phd launch it if necessary. - Navigate to /ponder/ ; observe sanity when adding questions, voting on them, and adding answers. - Confirm that questions and answers are linkable using Q5 / Q5#A5 formatted object links. - Confirm that searching for Ponder Questions works using built-in search. Feedback on code / schema / whatever organization very welcome. Reviewers: nh, vrana, epriestley Reviewed By: epriestley CC: gmarcotte, aran, Korvin, starruler Differential Revision: https://secure.phabricator.com/D3136
50 lines
No EOL
2 KiB
SQL
50 lines
No EOL
2 KiB
SQL
CREATE TABLE `{$NAMESPACE}_ponder`.`ponder_question` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`title` varchar(255) NOT NULL,
|
|
`phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`voteCount` int(10) NOT NULL,
|
|
`authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`content` longtext CHARACTER SET utf8 NOT NULL,
|
|
`dateCreated` int(10) unsigned NOT NULL,
|
|
`dateModified` int(10) unsigned NOT NULL,
|
|
`contentSource` varchar(255) DEFAULT NULL,
|
|
`heat` float NOT NULL,
|
|
`answerCount` int(10) unsigned NOT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `phid` (`phid`),
|
|
KEY `authorPHID` (`authorPHID`),
|
|
KEY `heat` (`heat`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `{$NAMESPACE}_ponder`.`ponder_answer` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`questionID` int(10) unsigned NOT NULL,
|
|
`phid` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`voteCount` int(10) NOT NULL,
|
|
`authorPHID` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`content` longtext CHARACTER SET utf8 NOT NULL,
|
|
`dateCreated` int(10) unsigned NOT NULL,
|
|
`dateModified` int(10) unsigned NOT NULL,
|
|
`contentSource` varchar(255) DEFAULT NULL,
|
|
PRIMARY KEY (`id`),
|
|
UNIQUE KEY `phid` (`phid`),
|
|
KEY `questionID` (`questionID`),
|
|
KEY `authorPHID` (`authorPHID`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `{$NAMESPACE}_ponder`.`edge` (
|
|
`src` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`type` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`dst` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
`dateCreated` int(10) unsigned NOT NULL,
|
|
`seq` int(10) unsigned NOT NULL,
|
|
`dataID` int(10) unsigned DEFAULT NULL,
|
|
PRIMARY KEY (`src`,`type`,`dst`),
|
|
KEY `src` (`src`,`type`,`dateCreated`,`seq`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
|
|
|
CREATE TABLE `{$NAMESPACE}_ponder`.`edgedata` (
|
|
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
|
`data` longtext CHARACTER SET utf8 COLLATE utf8_bin NOT NULL,
|
|
PRIMARY KEY (`id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |