[TikiWiki-commits] [Git][tikiwiki/tiki][master] [FIX] Comments: optimize database update patch case of populated tiki_comments...

Benoit Grégoire (@benoitg) via TikiWiki-cvs <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <699471be94068_3b18676c19387@gitlab-sidekiq-low-urgency-cpu-bound-v2-599bdbfbc7-8pr4d.mail>

Benoit Grégoire pushed to branch master at Tiki Wiki CMS Groupware / Tiki


Commits:
2c3ccded by Sammy Ndabo at 2026-02-17T13:39:19+00:00
[FIX] Comments: optimize database update patch case of populated tiki_comments table and remove no_repeats index key
---
* [FIX] tiki_comments: remove idx_comments_message_lookup index

* [FIX] tiki_comments: rename no_repeats index and align migrations for legacy/new index names

* [FIX] tiki_comments: change UNIQUE key to regular key for no_repeats index

* [FIX] tiki_comments: change UNIQUE key to regular key for no_repeats index

* [FIX] tiki_comments: optimize database update case of populated tiki_comments table

See merge request tikiwiki/tiki!9036

- - - - -


3 changed files:

- db/tiki.sql
- installer/schema/20251104_update_messageid_from_tiki_comments_tiki.sql
- installer/schema/20251128_reduce_tiki_comments_index_prefix_lenght_tiki.sql


Changes:

=====================================
db/tiki.sql
=====================================
@@ -724,7 +724,6 @@ CREATE TABLE `tiki_comments` (
   `approved` char(1) NOT NULL default 'y',
   `locked` char(1) NOT NULL default 'n',
   PRIMARY KEY (`threadId`),
-  UNIQUE KEY `no_repeats` (`parentId`, `userName`(20), `title`(30), `commentDate`, `message_id`(30), `in_reply_to`(30)),
   KEY `title` (`title`(191)),
   KEY `data` (`data`(191)),
   KEY `hits` (hits),
@@ -3649,7 +3648,7 @@ UPDATE tiki_menu_options SET icon = 'list' WHERE name = 'List PeerTube Media';
 UPDATE tiki_menu_options SET icon = 'upload' WHERE name = 'Upload PeerTube Video';
 UPDATE tiki_menu_options SET icon = 'tasks' WHERE name = 'Queued Tasks';
 
-UPDATE tiki_menus SET use_items_icons = 'y' WHERE menuId = 42; 
+UPDATE tiki_menus SET use_items_icons = 'y' WHERE menuId = 42;
 
 DROP TABLE IF EXISTS `tiki_plugin_security`;
 CREATE TABLE `tiki_plugin_security` (
@@ -4321,4 +4320,4 @@ CREATE TABLE `tiki_password_reset_tokens` (
   UNIQUE KEY `token` (`token`),
   KEY `user` (`user`),
   KEY `expires` (`expires`)
-) ENGINE=MyISAM;
\ No newline at end of file
+) ENGINE=MyISAM;


=====================================
installer/schema/20251104_update_messageid_from_tiki_comments_tiki.sql
=====================================
@@ -1,2 +1,6 @@
-ALTER TABLE `tiki_comments` MODIFY `message_id` TEXT default NULL;
-ALTER TABLE `tiki_comments` MODIFY `in_reply_to` varchar(255) default NULL;
\ No newline at end of file
+ALTER TABLE `tiki_comments`
+    DROP INDEX `threaded`,
+    DROP INDEX `no_repeats`,
+    MODIFY `message_id` TEXT default NULL,
+    MODIFY `in_reply_to` varchar(255) default NULL,
+    ADD KEY `threaded` (`message_id`(89),`in_reply_to`(88),`parentId`);


=====================================
installer/schema/20251128_reduce_tiki_comments_index_prefix_lenght_tiki.sql
=====================================
@@ -1,4 +1,2 @@
 ALTER TABLE `tiki_comments` DROP INDEX `threaded`;
 ALTER TABLE `tiki_comments` ADD KEY `threaded` (`message_id`(40),`in_reply_to`(40),`parentId`);
-ALTER TABLE tiki_comments DROP INDEX no_repeats;
-ALTER TABLE tiki_comments ADD UNIQUE KEY no_repeats ( parentId, userName(20), title(30), commentDate, message_id(30), in_reply_to(30));
\ No newline at end of file



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2c3ccded8b7ee97828de50ccd7044a7d7be7097c

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/2c3ccded8b7ee97828de50ccd7044a7d7be7097c
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.