]> git.notmuchmail.org Git - notmuch/commit
lib: Implement versioning in the database and provide upgrade function.
authorCarl Worth <cworth@cworth.org>
Fri, 8 Jan 2010 02:26:31 +0000 (18:26 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 8 Jan 2010 02:26:31 +0000 (18:26 -0800)
commit909f52bd8c4bdfa11cd3e75e3d0959e0293689bd
tree888ebc24e2b975d6c390e610c108a9e9fb4ecce9
parent21f8fd6967c3ef8e726652bbd6944e29975508b5
lib: Implement versioning in the database and provide upgrade function.

The recent support for renames in the database is our first time
(since notmuch has had more than a single user) that we have a
database format change. To support smooth upgrades we now encode a
database format version number in the Xapian metadata.

Going forward notmuch will emit a warning if used to read from a
database with a newer version than it natively supports, and will
refuse to write to a database with a newer version.

The library also provides functions to query the database format
version:

notmuch_database_get_version

to ask if notmuch wants a newer version than that:

notmuch_database_needs_upgrade

and a function to actually perform that upgrade:

notmuch_database_upgrade
lib/database-private.h
lib/database.cc
lib/message.cc
lib/notmuch-private.h
lib/notmuch.h