[tracker/ontology-cope-for-master: 10/11] libtracker-data: Nicer debugging messages during alter table
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/ontology-cope-for-master: 10/11] libtracker-data: Nicer debugging messages during alter table
- Date: Mon, 22 Feb 2010 14:26:53 +0000 (UTC)
commit 2b50eebfc9efb9b327156af091a861af328d1ab0
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 e2a97f9..ce78136 100644
--- a/src/libtracker-data/tracker-data-manager.c
+++ b/src/libtracker-data/tracker-data-manager.c
@@ -1242,6 +1242,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);
@@ -1271,6 +1273,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);
@@ -1295,11 +1303,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]