Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

test_migrations.sh 615B

12345678910111213141516171819202122
  1. #!/usr/bin/env bash
  2. #
  3. # Test migrations run correctly
  4. # Fail if any command fails
  5. # http://stackoverflow.com/questions/90418/exit-shell-script-based-on-process-exit-code
  6. set -e
  7. set -o pipefail
  8. if [ ! "$TRAVIS" == "true" ]
  9. then
  10. # If not on Travis, then create database
  11. echo "Creating PostgreSQL database and user"
  12. psql -c "DROP ROLE IF EXISTS travis"
  13. psql -c "CREATE ROLE travis LOGIN PASSWORD ''"
  14. psql -c "DROP DATABASE IF EXISTS oscar_travis"
  15. psql -c "CREATE DATABASE oscar_travis"
  16. fi
  17. # Postgres
  18. echo "Running migrations against Postgres"
  19. ./manage.py migrate --noinput --settings=settings_postgres