ci: let pgloader do all the clean and creation work
This commit is contained in:
parent
a1185a8eeb
commit
2ebe85872c
|
@ -1,22 +1,22 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Drop dummy ietf DB if it exists..."
|
||||
dropdb -U django --if-exists ietf
|
||||
|
||||
echo "Create new ietf DB..."
|
||||
createdb -U django ietf
|
||||
|
||||
echo "Enable citext extension..."
|
||||
psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'CREATE EXTENSION IF NOT EXISTS citext;'
|
||||
|
||||
echo "Set schema search path for user django..."
|
||||
psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
|
||||
#echo "Drop dummy ietf DB if it exists..."
|
||||
#dropdb -U django --if-exists ietf
|
||||
#
|
||||
#echo "Create new ietf DB..."
|
||||
#createdb -U django ietf
|
||||
#
|
||||
#echo "Enable citext extension..."
|
||||
#psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'CREATE EXTENSION IF NOT EXISTS citext;'
|
||||
#
|
||||
#echo "Set schema search path for user django..."
|
||||
#psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
|
||||
|
||||
echo "Import DB dump into ietf..."
|
||||
pg_restore -U django -d ietf ietf.dump
|
||||
pg_restore --clean --if-exists --create -U django -d ietf ietf.dump
|
||||
|
||||
echo "Set schema search path for user django..."
|
||||
psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
|
||||
#echo "Set schema search path for user django..."
|
||||
#psql -U django -d ietf -v ON_ERROR_STOP=1 -c '\x' -c 'ALTER USER django set search_path=ietf_utf8,django,public;'
|
||||
|
||||
echo "Done!"
|
||||
|
|
Loading…
Reference in a new issue