[tracker/ontology-cope] libtracker-data: Nicer debugging messages during alter table



commit 36dd93c0e2c8fdcb54903ef5bf58ac791be01bf4
Author: Philip Van Hoof <philip codeminded be>
Date:   Fri Feb 19 12:00:05 2010 +0100

    libtracker-data: Nicer debugging messages during alter table

 src/libtracker-data/tracker-data-manager.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-data-manager.c b/src/libtracker-data/tracker-data-manager.c
index 77ae9f3..603c1bb 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1228,6 +1228,8 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
 
 
 	if (!is_new || (is_new && tracker_class_get_is_new (service))) {
+		if (is_new)
+			g_debug ("Altering database with new class '%s' (create)", service_name);
 		in_alter = FALSE;
 		create_sql = g_string_new ("");
 		g_string_append_printf (create_sql, "CREATE TABLE \"%s\" (ID INTEGER NOT NULL PRIMARY KEY", service_name);
@@ -1257,6 +1259,12 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
 			if (sql_type_for_single_value) {
 				/* single value */
 
+				if (is_new) {
+					g_debug ("%sAltering database for class '%s' property '%s': single value (%s)",
+					         in_alter ? "" : "\t", service_name, field_name, 
+					         in_alter ? "alter" : "create");
+				}
+
 				if (!in_alter) {
 					class_properties = g_slist_prepend (class_properties, property);
 
@@ -1272,11 +1280,6 @@ create_decomposed_metadata_tables (TrackerDBInterface *iface,
 				} else if (tracker_property_get_is_new (property)) {
 					GString *alter_sql = NULL;
 
-					if (is_new) {
-						g_debug ("Altering database for class '%s' property '%s': single value",
-						         service_name, field_name);
-					}
-
 					class_properties = g_slist_prepend (class_properties, property);
 
 					alter_sql = g_string_new ("ALTER TABLE ");



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