<commit_before>-- Ensure that PermName is no longer than 50 characters, which seems to be the maximum allowed
-- by MySQL Full Text Search as Unified Search Index. We could allow longer permanent names when other
-- search index engines are the ones being used, but this will probably only delay the problem until the admin
-- wants to change the search engine for some reason (some constrains in Lucene or Elastic Search,
-- as experience demonstrated in some production sites in real use cases over long periods of time).
-- And to increase chances to avoid conflict when long names only differ in the end of the long string,
-- where some meaningful info resides, we'll get the first 40 chars, 1 underscore and the last 9 chars.
--
--  Using same arbitrary convention as added in the code here: https://sourceforge.net/p/tikiwiki/code/59180
--
-- This upgrade script is not placed under the installer/schema folder by default since it might potentially
-- break some installations upon upgrade if they were using such long permanent names for real.
-- Therefore, we leave this upgrade script here under doc/devtools/ by default, so that each admin can
-- move it to installer/schema in their own install at their own risk.
UPDATE `tiki_tracker_fields`
SET permName = REPLACE(permName,
                       permName,
                       (SELECT CONCAT( LEFT(permName, 40), '_', RIGHT(permName, 9)))
                      )
WHERE char_length(permName) > 50

<commit_msg>[FIX]Update maximum length allowed for permNames to 36 instead of 50, since tiki will internally prepend 14 extra characters to them (tracker_field_).<commit_after>-- Ensure that PermName is no longer than 36 characters, since the maximum allowed
-- by MySQL Full Text Search as Unified Search Index is 50, and trackers will internally prepend
-- "tracker_field_", which are another 14 characters (36+14=50). We could allow longer permanent names when other
-- search index engines are the ones being used, but this will probably only delay the problem until the admin
-- wants to change the search engine for some reason (some constrains in Lucene or Elastic Search,
-- as experience demonstrated in some production sites in real use cases over long periods of time).
-- And to increase chances to avoid conflict when long names only differ in the end of the long string,
-- where some meaningful info resides, we'll get the first 26 chars, 1 underscore and the last 9 chars.
--
--  Using same arbitrary convention as added in the code here: https://sourceforge.net/p/tikiwiki/code/59200
--
-- This upgrade script is not placed under the installer/schema folder by default since it might potentially
-- break some installations upon upgrade if they were using such long permanent names for real.
-- Therefore, we leave this upgrade script here under doc/devtools/ by default, so that each admin can
-- move it to installer/schema in their own install at their own risk.
UPDATE `tiki_tracker_fields`
SET permName = REPLACE(permName,
                       permName,
                       (SELECT CONCAT( LEFT(permName, 26), '_', RIGHT(permName, 9)))
                      )
WHERE char_length(permName) > 36


{'fraction_non_alphanumeric': 0.057770800627943486, 'fraction_numerical': 0.015070643642072213, 'mean_word_length': 3.4684431977559607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6649534', 'n_tokens_mistral': 817, 'n_tokens_neox': 741, 'n_words': 446}