fix database script in functional test