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>
commit957fbac33899fc5c2939237d53d0a1a2b2eed534
parent90d9c7d9fc1d276aedd942b7c8c5980a09f53ae0
authorJarek Kobus <jaroslaw.kobus@qt.io>
committerJarek Kobus <jaroslaw.kobus@qt.io>
commit timeFri, 2 Oct 2026 16:06:09 +0000