Complete database rework