fix database schemes and test