mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
8363c90531
Previously, our database schema was versioned by a single number. Each database schema change had to occur "atomically" in Notmuch's development history: before some commit, Notmuch used version N, after that commit, it used version N+1. Hence, each new schema version could introduce only one change, the task of developing a schema change fell on a single person, and it all had to happen and be perfect in a single commit series. This made introducing a new schema version hard. We've seen only two schema changes in the history of Notmuch. This commit introduces database schema version 3; hopefully the last schema version we'll need for a while. With this version, we switch from a single version number to "features": a set of named, independent aspects of the database schema. Features should make backwards compatibility easier. For many things, it should be easy to support databases both with and without a feature, which will allow us to make upgrades optional and will enable "unstable" features that can be developed and tested over time. Features also make forwards compatibility easier. The features recorded in a database include "compatibility flags," which can indicate to an older version of Notmuch when it must support a given feature to open the database for read or for write. This lets us replace the old vague "I don't recognize this version, so something might go wrong, but I promise to try my best" warnings upon opening a database with an unknown version with precise errors. If a database is safe to open for read/write despite unknown features, an older version will know that and issue no message at all. If the database is not safe to open for read/write because of unknown features, an older version will know that, too, and can tell the user exactly which required features it lacks support for. |
||
---|---|---|
.. | ||
database-private.h | ||
database.cc | ||
directory.cc | ||
filenames.c | ||
gen-version-script.sh | ||
index.cc | ||
libsha1.c | ||
libsha1.h | ||
Makefile | ||
Makefile.local | ||
message-file.c | ||
message.cc | ||
messages.c | ||
notmuch-private.h | ||
notmuch.h | ||
parse-time-vrp.cc | ||
parse-time-vrp.h | ||
query.cc | ||
sha1.c | ||
string-list.c | ||
tags.c | ||
thread.cc |