Add shrinkDatabase function.