[qtcontacts-sqlite] Fix extended upgrade sequence fault

If we create a table in an upgrade statement, and subsequently alter
the same table in a later upgrade statement, the definition of the
table created in the earlier upgrade must be altered to match the
original version. Otherwise, an extended upgrade process will create
the final version of the table and then subsequently fail when the
alteration is attempted.
[qtcontacts-sqlite] Remove partial name matching

Previously we would automatically aggregate contacts under various
conditions where the last name was a match, and there was a partial
match between the first name values.  This has now been removed, as
it produces more false positive matches in some locales than initially
expected.
Merge pull request #169 from matthewvogt/remove-auto-partial-match

[qtcontacts-sqlite] Remove partial name matching
[qtcontacts-sqlite] Sort according to current locale

Use ICU collation to sort by the current locale's ordering, on fields
used for visual display.
Merge pull request #171 from matthewvogt/localized-sort

[qtcontacts-sqlite] Sort according to current locale
[qtcontacts-sqlite] Alter schema for improved query speed

SQLite generates better query plans using a simplified schema, where
the specific detail tables can be joined to the primary Details table
using only their corresponding rowid columns.

This commit contains only the schema changes, a following commit
provides the script to migrate from old to new schema.
[qtcontacts-sqlite] Migrate existing databases to updated schema

Includes renaming the TpMetadata table to the correct name.
Merge pull request #166 from matthewvogt/schema-variation

Alter schema to improve query speed for contact details
[qtcontacts-sqlite] Join detail tables so we make a single query to read details

Rather than reading all detail tables in parallel queries, join them
all into a single query of the Details table.
[qtcontacts-sqlite] Un-batch the joined detail tables query

It is simpler to use a single query traversed in order than to repeat
the query for input batches.
[qtcontacts-sqlite] Make relationship query sequential
[qtcontacts-sqlite] Modify relationships query to use indexes correctly

SQLite refuses to use the obvious index for the previous query
formulation; if we reverse the order of joins it does the right thing.
[qtcontacts-sqlite] Use cross join to force query order

SQLite allows manual optimization by using the 'cross join' operator,
which in addition to specifying a join instructs SQLite that it must
process the joined table after the table it is joined to.

Use the cross join operator to ensure we traverse the temporary table
of IDs before joining other data tables by index.
[qtcontacts-sqlite] Remove queryContacts internal batching

The batching inside the query processing code may provide a small
benefit or cost to overall performance; it varies from test to test
and can't be isolated.  Therefore, it is best to remove it for the
purpose of simplifying the code and requiring less maintenance of
state while processing the database records.
[qtcontacts-sqlite] Use maximumCount fetch hint to limit query

Rather than limiting the amount of data returned from the query, we
should limit the amount of data we retrieve from the database.
[qtcontacts-sqlite] Simplify query handling

Separate queries to separate functions to make the query management
logic more self-contained.
[qtcontacts-sqlite] Add debug output of SQL queries

Define QTCONTACTS_SQLITE_DEBUG_SQL to non-empty in the environment
to report all SQL queries produced by the use of the QtContacts API.