From 7773967c717ea6e1fd4433540c2373f967864da0 Mon Sep 17 00:00:00 2001
From: "alejandro.campos@artica.es" <alejandro.campos@artica.es>
Date: Wed, 21 Feb 2024 10:11:37 +0100
Subject: [PATCH] move mr

---
 pandora_console/extras/mr/68.sql             |  9 +++++++++
 pandora_console/extras/mr/70.sql             | 12 ------------
 pandora_console/include/functions_events.php |  2 +-
 3 files changed, 10 insertions(+), 13 deletions(-)
 delete mode 100644 pandora_console/extras/mr/70.sql

diff --git a/pandora_console/extras/mr/68.sql b/pandora_console/extras/mr/68.sql
index 6315c64ae7..4d53485fe6 100644
--- a/pandora_console/extras/mr/68.sql
+++ b/pandora_console/extras/mr/68.sql
@@ -1,5 +1,14 @@
 START TRANSACTION;
 
+-- Watch out! The following field migration must be done before altering the corresponding table.
+UPDATE `tevent_filter`
+SET `search` = `regex`,
+    `regex` = '1'
+WHERE `regex` IS NOT NULL AND `regex` != '';
+
+-- Watch out! The following alter command must be done after the previous update of this table.
+ALTER TABLE `tevent_filter` MODIFY COLUMN `regex` TINYINT unsigned NOT NULL DEFAULT 0;
+
 CREATE TABLE IF NOT EXISTS `tmerge_error` (
     `id` int(10) NOT NULL auto_increment,
     `id_node` int(10) default 0,
diff --git a/pandora_console/extras/mr/70.sql b/pandora_console/extras/mr/70.sql
deleted file mode 100644
index 53249ee2bf..0000000000
--- a/pandora_console/extras/mr/70.sql
+++ /dev/null
@@ -1,12 +0,0 @@
-START TRANSACTION;
-
--- Watch out! The following field migration must be done before altering the corresponding table.
-UPDATE `tevent_filter`
-SET `search` = `regex`,
-    `regex` = '1'
-WHERE `regex` IS NOT NULL AND `regex` != '';
-
--- Watch out! The following alter command must be done after the previous update of this table.
-ALTER TABLE `tevent_filter` MODIFY COLUMN `regex` TINYINT unsigned NOT NULL DEFAULT 0;
-
-COMMIT;
\ No newline at end of file
diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 1af55ab3ea..eb2da52535 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -1185,7 +1185,7 @@ function events_get_all(
             $comp_pattern = 'LIKE lower("%%%s%%")';
 
             // Disregard repeated whitespaces in search (customer requirement).
-            // Apply in both column stored value and search term.
+            // Conversion must be applied in both column stored value and search term.
             $search_term = preg_replace('/(&#x20;)+/', '&#x20;', $filter['search']);
             $search_column_pattern = 'REGEXP_REPLACE(%s, "(&#x20;\\s*)+", "&#x20;")';
         }