[evolution-data-server/cursor-staging: 4/26] EBookBackendSqliteDB: introspect summary structure before adding columns.
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/cursor-staging: 4/26] EBookBackendSqliteDB: introspect summary structure before adding columns.
- Date: Sat, 12 Oct 2013 20:44:59 +0000 (UTC)
commit 4a25363d269c71a434c23a5ed31e591d7761dd7d
Author: Tristan Van Berkom <tristanvb openismus com>
Date: Sat Oct 12 20:54:55 2013 +0200
EBookBackendSqliteDB: introspect summary structure before adding columns.
Some additional auxilary columns need to be added in upgrades, these
columns which need to be added depend on which contact fields are
in the summary. This patch ensures that the summary is properly
introspected before adding columns, so that the right columns are added.
.../libedata-book/e-book-backend-sqlitedb.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 0898786..24fdc9f 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -900,6 +900,14 @@ create_contacts_table (EBookBackendSqliteDB *ebsdb,
if (!success)
return FALSE;
+ /* Introspect the summary if the table already exists */
+ if (success && already_exists) {
+ success = introspect_summary (ebsdb, folderid, error);
+
+ if (success)
+ return FALSE;
+ }
+
string = g_string_new (
"CREATE TABLE IF NOT EXISTS %Q ( uid TEXT PRIMARY KEY, ");
@@ -982,10 +990,6 @@ create_contacts_table (EBookBackendSqliteDB *ebsdb,
g_free (tmp);
}
- /* Dont introspect the summary if the table did not yet exist */
- if (success && already_exists)
- success = introspect_summary (ebsdb, folderid, error);
-
/* Create indexes on the summary fields configured for indexing */
for (i = 0; success && i < ebsdb->priv->n_summary_fields; i++) {
if ((ebsdb->priv->summary_fields[i].index & INDEX_PREFIX) != 0 &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]