diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index d0ee0bdc1..7cf8a26d3 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -243,7 +243,7 @@ LocalStore::LocalStore( else if (curSchema == 0) { /* new store */ curSchema = nixSchemaVersion; openDB(*state, true); - writeFile(schemaPath, fmt("%1%", nixSchemaVersion), 0666, true); + writeFile(schemaPath, fmt("%1%", curSchema), 0666, true); } else if (curSchema < nixSchemaVersion) {