[tracker/wip/carlosg/sparql1.1: 22/113] libtracker-data: Remove leftovers from "*:graph" columns



commit ad6167550cf2f104101ea7ad3e92e76830dca58b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Jun 4 12:00:37 2019 +0200

    libtracker-data: Remove leftovers from "*:graph" columns
    
    Those are unneeded now that we have a proper implementation for
    graphs.

 src/libtracker-data/tracker-data-manager.c | 54 ++++--------------------------
 src/libtracker-data/tracker-data-update.c  | 12 +------
 2 files changed, 8 insertions(+), 58 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 69f889ebf..8673d95cb 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -2538,25 +2538,20 @@ range_change_for (TrackerProperty *property,
         * should forbid conversion from anything to resource or datetime in error
         * handling earlier */
 
-       g_string_append_printf (in_col_sql, ", \"%s\", \"%s:graph\"",
-                               field_name, field_name);
+       g_string_append_printf (in_col_sql, ", \"%s\"", field_name);
 
        if (tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_INTEGER ||
            tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_DOUBLE) {
-                       g_string_append_printf (sel_col_sql, ", \"%s\" + 0, \"%s:graph\"",
-                                               field_name, field_name);
+                       g_string_append_printf (sel_col_sql, ", \"%s\" + 0", field_name);
        } else if (tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_DATETIME) {
 
                /* TODO (see above) */
 
-               g_string_append_printf (sel_col_sql, ", \"%s\", \"%s:graph\"",
-                                       field_name, field_name);
+               g_string_append_printf (sel_col_sql, ", \"%s\"", field_name);
        } else if (tracker_property_get_data_type (property) == TRACKER_PROPERTY_TYPE_BOOLEAN) {
-               g_string_append_printf (sel_col_sql, ", \"%s\" != 0, \"%s:graph\"",
-                                       field_name, field_name);
+               g_string_append_printf (sel_col_sql, ", \"%s\" != 0", field_name);
        } else {
-               g_string_append_printf (sel_col_sql, ", \"%s\", \"%s:graph\"",
-                                       field_name, field_name);
+               g_string_append_printf (sel_col_sql, ", \"%s\"", field_name);
        }
 }
 
@@ -2655,14 +2650,12 @@ create_decomposed_metadata_property_table (TrackerDBInterface *iface,
                        g_string_append_printf (sql,
                                                "CREATE TABLE \"%s\".\"%s_%s\" ("
                                                "ID INTEGER NOT NULL, "
-                                               "\"%s\" %s NOT NULL, "
-                                               "\"%s:graph\" INTEGER",
+                                               "\"%s\" %s NOT NULL",
                                                database,
                                                service_name,
                                                field_name,
                                                field_name,
-                                               sql_type,
-                                               field_name);
+                                               sql_type);
 
                        if (in_change && !tracker_property_get_is_new (property)) {
                                in_col_sql = g_string_new ("ID");
@@ -3149,13 +3142,6 @@ create_decomposed_metadata_tables (TrackerDataManager  *manager,
                                        if (tracker_property_get_is_inverse_functional_property (property)) {
                                                g_string_append (create_sql, " UNIQUE");
                                        }
-
-                                       g_string_append_printf (create_sql, ", \"%s:graph\" INTEGER",
-                                                               field_name);
-
-                                       if (is_domain_index && tracker_property_get_is_new_domain_index 
(property, service)) {
-                                               schedule_copy (copy_schedule, property, field_name, ":graph");
-                                       }
                                } else if ((!is_domain_index && tracker_property_get_is_new (property)) ||
                                           (is_domain_index && tracker_property_get_is_new_domain_index 
(property, service))) {
                                        GString *alter_sql = NULL;
@@ -3214,32 +3200,6 @@ create_decomposed_metadata_tables (TrackerDataManager  *manager,
                                        }
 
                                        g_string_free (alter_sql, TRUE);
-
-                                       alter_sql = g_string_new ("ALTER TABLE ");
-                                       g_string_append_printf (alter_sql, "\"%s\".\"%s\" ADD COLUMN 
\"%s:graph\" INTEGER",
-                                                               database,
-                                                               service_name,
-                                                               field_name);
-                                       g_debug ("Altering: '%s'", alter_sql->str);
-                                       tracker_db_interface_execute_query (iface, &internal_error,
-                                                                           "%s", alter_sql->str);
-                                       if (internal_error) {
-                                               g_string_free (alter_sql, TRUE);
-                                               g_propagate_error (error, internal_error);
-                                               goto error_out;
-                                       } else if (is_domain_index) {
-                                               copy_from_domain_to_domain_index (iface, database, property,
-                                                                                 field_name, ":graph",
-                                                                                 service,
-                                                                                 &internal_error);
-                                               if (internal_error) {
-                                                       g_string_free (alter_sql, TRUE);
-                                                       g_propagate_error (error, internal_error);
-                                                       goto error_out;
-                                               }
-                                       }
-
-                                       g_string_free (alter_sql, TRUE);
                                } else {
                                        put_change = TRUE;
                                }
diff --git a/src/libtracker-data/tracker-data-update.c b/src/libtracker-data/tracker-data-update.c
index 96eea1a50..c6b330de5 100644
--- a/src/libtracker-data/tracker-data-update.c
+++ b/src/libtracker-data/tracker-data-update.c
@@ -817,10 +817,9 @@ tracker_data_resource_buffer_flush (TrackerData                      *data,
                                                                                      property->name);
                                } else {
                                        stmt = tracker_db_interface_create_statement (iface, 
TRACKER_DB_STATEMENT_CACHE_TYPE_UPDATE, &actual_error,
-                                                                                     "INSERT OR IGNORE INTO 
\"%s\".\"%s\" (ID, \"%s\", \"%s:graph\") VALUES (?, ?, ?)",
+                                                                                     "INSERT OR IGNORE INTO 
\"%s\".\"%s\" (ID, \"%s\") VALUES (?, ?)",
                                                                                      database,
                                                                                      table_name,
-                                                                                     property->name,
                                                                                      property->name);
                                }
 
@@ -920,15 +919,11 @@ tracker_data_resource_buffer_flush (TrackerData                      *data,
                                if (table->insert) {
                                        g_string_append_printf (sql, ", \"%s\"", property->name);
                                        g_string_append (values_sql, ", ?");
-
-                                       g_string_append_printf (sql, ", \"%s:graph\"", property->name);
-                                       g_string_append (values_sql, ", ?");
                                } else {
                                        if (i > 0) {
                                                g_string_append (sql, ", ");
                                        }
                                        g_string_append_printf (sql, "\"%s\" = ?", property->name);
-                                       g_string_append_printf (sql, ", \"%s:graph\" = ?", property->name);
                                }
                        }
 
@@ -976,11 +971,6 @@ tracker_data_resource_buffer_flush (TrackerData                      *data,
                                } else {
                                        statement_bind_gvalue (stmt, &param, &property->value);
                                }
-                               if (resource->graph->id != 0) {
-                                       tracker_db_statement_bind_int (stmt, param++, resource->graph->id);
-                               } else {
-                                       tracker_db_statement_bind_null (stmt, param++);
-                               }
                        }
 
                        if (!table->insert) {


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