updated sql migration for postgres