[tracker/wip/carlosg/update-perf: 5/61] core: Bump database version




commit 847ab086200a01d3ce928b84bc6ee2fd5d61a3ce
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 22 16:15:59 2022 +0200

    core: Bump database version
    
    In order to fix the fts_view views as per the previous commit.

 src/libtracker-sparql/core/tracker-data-manager.c | 15 +++++++++++++++
 src/libtracker-sparql/core/tracker-db-manager.h   |  1 +
 2 files changed, 16 insertions(+)
---
diff --git a/src/libtracker-sparql/core/tracker-data-manager.c 
b/src/libtracker-sparql/core/tracker-data-manager.c
index 192bcf4a2..38dffd984 100644
--- a/src/libtracker-sparql/core/tracker-data-manager.c
+++ b/src/libtracker-sparql/core/tracker-data-manager.c
@@ -4194,6 +4194,21 @@ tracker_data_manager_update_from_version (TrackerDataManager  *manager,
                        goto error;
        }
 
+       if (version < TRACKER_DB_VERSION_3_4) {
+               GHashTableIter iter;
+               const gchar *graph;
+
+               if (!tracker_data_manager_update_fts (manager, iface, "main", &internal_error))
+                       goto error;
+
+               g_hash_table_iter_init (&iter, manager->graphs);
+
+               while (g_hash_table_iter_next (&iter, (gpointer *) &graph, NULL)) {
+                       if (!tracker_data_manager_update_fts (manager, iface, graph, &internal_error))
+                               goto error;
+               }
+       }
+
        tracker_db_manager_update_version (manager->db_manager);
        return TRUE;
 
diff --git a/src/libtracker-sparql/core/tracker-db-manager.h b/src/libtracker-sparql/core/tracker-db-manager.h
index 941ecad9d..e36780b2e 100644
--- a/src/libtracker-sparql/core/tracker-db-manager.h
+++ b/src/libtracker-sparql/core/tracker-db-manager.h
@@ -52,6 +52,7 @@ typedef enum {
        /* Starts at 25 because we forgot to clean up */
        TRACKER_DB_VERSION_3_0 = 25, /* 3.0 */
        TRACKER_DB_VERSION_3_3,      /* Blank nodes */
+       TRACKER_DB_VERSION_3_4,      /* Fixed FTS view */
 } TrackerDBVersion;
 
 /* Set current database version we are working with */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]