+--
+-- TABLE post-question
+--
+CREATE TABLE IF NOT EXISTS `post-question` (
+ `id` int unsigned NOT NULL auto_increment COMMENT 'sequential ID',
+ `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
+ `multiple` boolean NOT NULL DEFAULT '0' COMMENT 'Multiple choice',
+ `voters` int unsigned COMMENT 'Number of voters for this question',
+ `end-time` datetime DEFAULT '0001-01-01 00:00:00' COMMENT 'Question end time',
+ PRIMARY KEY(`id`),
+ UNIQUE INDEX `uri-id` (`uri-id`),
+ FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Question';
+
+--
+-- TABLE post-question-option
+--
+CREATE TABLE IF NOT EXISTS `post-question-option` (
+ `id` int unsigned NOT NULL COMMENT 'Id of the question',
+ `uri-id` int unsigned NOT NULL COMMENT 'Id of the item-uri table entry that contains the item uri',
+ `name` varchar(255) COMMENT 'Name of the option',
+ `replies` int unsigned COMMENT 'Number of replies for this question option',
+ PRIMARY KEY(`uri-id`,`id`),
+ FOREIGN KEY (`uri-id`) REFERENCES `item-uri` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE
+) DEFAULT COLLATE utf8mb4_general_ci COMMENT='Question option';
+