Following the discussions here #1582, a CLI tool to do the database maintenance can be useful in case of broken configuration.