Update schema to v7; correctly order entries in cache.