Fix database install code