make database schema postgresql compatible