Knowledge Base stage 4: Was this helpful? under articles in the client portal and public help center with what was missing for a no, reads counted once a visit, a Readers column sortable by reads, a Needs a look view, a Feedback card on the article with Dealt with, a Not found list of searches that found nothing with Write an article, a main menu count of articles due for review or not helping, database 3.9.7 with kb_article_views, kb_article_feedback and kb_search_misses, and changelog entries

This commit is contained in:
johnnyq
2026-11-18 18:12:03 -05:00
parent 358b23c91d
commit 40da408d3c
15 changed files with 718 additions and 20 deletions

48
db.sql
View File

@@ -1959,6 +1959,32 @@ CREATE TABLE `kb_article_clients` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `kb_article_feedback`
--
DROP TABLE IF EXISTS `kb_article_feedback`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kb_article_feedback` (
`kb_article_feedback_id` int(11) NOT NULL AUTO_INCREMENT,
`kb_article_feedback_helpful` tinyint(1) NOT NULL,
`kb_article_feedback_comment` varchar(500) DEFAULT NULL,
`kb_article_feedback_source` varchar(10) NOT NULL,
`kb_article_feedback_contact_id` int(11) NOT NULL DEFAULT 0,
`kb_article_feedback_client_id` int(11) NOT NULL DEFAULT 0,
`kb_article_feedback_ip` varchar(45) DEFAULT NULL,
`kb_article_feedback_created_at` datetime NOT NULL DEFAULT current_timestamp(),
`kb_article_feedback_dealt_at` datetime DEFAULT NULL,
`kb_article_feedback_dealt_by` int(11) NOT NULL DEFAULT 0,
`kb_article_feedback_kb_article_id` int(11) NOT NULL,
PRIMARY KEY (`kb_article_feedback_id`),
KEY `kb_article_feedback_kb_article_id` (`kb_article_feedback_kb_article_id`),
KEY `kb_article_feedback_ip` (`kb_article_feedback_ip`,`kb_article_feedback_created_at`),
CONSTRAINT `kb_article_feedback_ibfk_1` FOREIGN KEY (`kb_article_feedback_kb_article_id`) REFERENCES `kb_articles` (`kb_article_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `kb_article_tags`
--
@@ -2016,6 +2042,7 @@ CREATE TABLE `kb_articles` (
`kb_article_review_months` int(11) NOT NULL DEFAULT 0,
`kb_article_reviewed_at` datetime DEFAULT NULL,
`kb_article_reviewed_by` int(11) NOT NULL DEFAULT 0,
`kb_article_views` int(11) NOT NULL DEFAULT 0,
`kb_article_created_at` datetime NOT NULL DEFAULT current_timestamp(),
`kb_article_created_by` int(11) NOT NULL DEFAULT 0,
`kb_article_updated_at` datetime DEFAULT NULL,
@@ -2027,6 +2054,27 @@ CREATE TABLE `kb_articles` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `kb_search_misses`
--
DROP TABLE IF EXISTS `kb_search_misses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8mb4 */;
CREATE TABLE `kb_search_misses` (
`kb_search_miss_id` int(11) NOT NULL AUTO_INCREMENT,
`kb_search_miss_query` varchar(100) NOT NULL,
`kb_search_miss_source` varchar(10) NOT NULL,
`kb_search_miss_client_id` int(11) NOT NULL DEFAULT 0,
`kb_search_miss_searches` int(11) NOT NULL DEFAULT 1,
`kb_search_miss_first_at` datetime NOT NULL DEFAULT current_timestamp(),
`kb_search_miss_last_at` datetime NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`kb_search_miss_id`),
UNIQUE KEY `kb_search_miss_query` (`kb_search_miss_query`,`kb_search_miss_source`,`kb_search_miss_client_id`),
KEY `kb_search_miss_last_at` (`kb_search_miss_last_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `location_documents`
--