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

"Sammy Ndabo \(@ndabosam084\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <6994a5cc718cf_3b1868708097b@gitlab-sidekiq-low-urgency-cpu-bound-v2-59ddc7cd9c-7khlc.mail>

Sammy Ndabo pushed to branch 29.x at Tiki Wiki CMS Groupware / Tiki


Commits:
ca0ab620 by Sammy Ndabo at 2026-02-17T17:22:49+00:00
[FIX] Comments: optimize database update patch case of populated tiki_comments...
---
* [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

(cherry picked from commit 2c3ccded8b7ee97828de50ccd7044a7d7be7097c)

See merge request tikiwiki/tiki!9590

- - - - -


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),
@@ -3635,7 +3634,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` (
@@ -4276,4 +4275,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/ca0ab620aca8dba9e17cc752e811bb36ce6dec53

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/ca0ab620aca8dba9e17cc752e811bb36ce6dec53
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.