Skip to content

Instantly share code, notes, and snippets.

@markprzepiora
Created June 26, 2018 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markprzepiora/342a50af9dd25e37b6a6b4d118b8cccd to your computer and use it in GitHub Desktop.
Save markprzepiora/342a50af9dd25e37b6a6b4d118b8cccd to your computer and use it in GitHub Desktop.
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test;"
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test;"
psql --dbname=app_test --no-psqlrc -c < db/structure.sql
for n in $(seq 2 $parallel_tests_count); do
(
psql --dbname=postgres --no-psqlrc -c "DROP DATABASE IF EXISTS app_test$n;"
psql --dbname=postgres --no-psqlrc -c "CREATE DATABASE app_test$n WITH TEMPLATE app_test;"
) &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment