From 2ebe85872c637d22a9a5b18b12fc49cc32a895d2 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 2 Feb 2023 10:52:13 -0600 Subject: [PATCH] ci: let pgloader do all the clean and creation work --- docker/scripts/db-pg-import.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/docker/scripts/db-pg-import.sh b/docker/scripts/db-pg-import.sh index 5f780caec..6838bb28e 100644 --- a/docker/scripts/db-pg-import.sh +++ b/docker/scripts/db-pg-import.sh @@ -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!"