more migrations and fixes for postgres