From 117bb2a5b8ca18086ec8626e6a83f35ed9627dc5 Mon Sep 17 00:00:00 2001 From: Robert Sparks Date: Thu, 2 Feb 2023 13:19:37 -0600 Subject: [PATCH] ci: clean up after recent exploration. --- docker/scripts/db-load-default-extensions.sh | 5 +++++ docker/scripts/db-pg-import.sh | 13 +------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/docker/scripts/db-load-default-extensions.sh b/docker/scripts/db-load-default-extensions.sh index 914e4a961..23329267c 100644 --- a/docker/scripts/db-load-default-extensions.sh +++ b/docker/scripts/db-load-default-extensions.sh @@ -1,5 +1,10 @@ #!/bin/bash set -e +# Adding the extension to the default template is needed to allow the test-suite +# to be run on postgres (see ietf.settings_postgrestest). The test runner always +# makes a fresh test database instance, and since we are bypassing the migration +# framework and using a fixture to set the database structure, there's no reaonable +# way to install the extension as part of the test run. psql -U django -d template1 -v ON_ERROR_STOP=1 -c 'CREATE EXTENSION IF NOT EXISTS citext;' diff --git a/docker/scripts/db-pg-import.sh b/docker/scripts/db-pg-import.sh index c7284e7b0..96223df8a 100644 --- a/docker/scripts/db-pg-import.sh +++ b/docker/scripts/db-pg-import.sh @@ -4,19 +4,8 @@ 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;' - +# Extensions and search paths will be loaded from the dump echo "Import DB dump into ietf..." pg_restore --clean --if-exists --create -U django -d postgres 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 "Done!"