QtHelp: Add a schema version to the collection file
The format of the collection file was detected only by the names of
its tables, so a collection file written in a newer, incompatible
format couldn't be told apart from a current one, and would be
changed by an older version of Qt Help.
Store a schema version in PRAGMA user_version, and refuse to open a
collection file with a newer version, e.g. after a downgrade. This
takes effect once the version is increased for an incompatible change
of the format. Collection files without a version get the current
one. Missing tables are still recreated, as before.
Also report an error when the version can't be read, e.g. when the
file isn't a database. Previously, this failed on later queries, or,
in read-only mode, only after opening the collection file succeeded.
Task-number: QTBUG-150686
Pick-to: 6.12 6.8
Change-Id: I76f5f4b7c1410906045831b54ba1c3ee47a20dc7
Reviewed-by: Kai Köhne <kai.koehne@qt.io>