diff --git a/api/app/scripts/readonly_user_setup/_1_readonly_user_connect.sql b/api/app/scripts/readonly_user_setup/_1_readonly_user_connect.sql new file mode 100644 index 0000000000..392c9ac156 --- /dev/null +++ b/api/app/scripts/readonly_user_setup/_1_readonly_user_connect.sql @@ -0,0 +1 @@ +GRANT CONNECT ON DATABASE api TO readonly_sql_user; diff --git a/api/app/scripts/readonly_user_setup/_1_readonly_user_grant_schema.sql b/api/app/scripts/readonly_user_setup/_2_readonly_user_grant_schema.sql similarity index 100% rename from api/app/scripts/readonly_user_setup/_1_readonly_user_grant_schema.sql rename to api/app/scripts/readonly_user_setup/_2_readonly_user_grant_schema.sql diff --git a/api/app/scripts/readonly_user_setup/_2_readonly_user_grant_select.sql b/api/app/scripts/readonly_user_setup/_3_readonly_user_grant_select.sql similarity index 100% rename from api/app/scripts/readonly_user_setup/_2_readonly_user_grant_select.sql rename to api/app/scripts/readonly_user_setup/_3_readonly_user_grant_select.sql diff --git a/api/app/scripts/readonly_user_setup/_3_readonly_user_revoke_update_delete.sql b/api/app/scripts/readonly_user_setup/_4_readonly_user_revoke_update_delete.sql similarity index 100% rename from api/app/scripts/readonly_user_setup/_3_readonly_user_revoke_update_delete.sql rename to api/app/scripts/readonly_user_setup/_4_readonly_user_revoke_update_delete.sql diff --git a/orchestration/restore.sh b/orchestration/restore.sh index 60d687d7c7..e5f4688ab8 100755 --- a/orchestration/restore.sh +++ b/orchestration/restore.sh @@ -19,11 +19,11 @@ if [ "${DROP_PUBLIC}" == "yes" ]; then echo "Recreating the public schema" psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema public cascade; create schema public;" echo "Dropping the ddls145 schema" - psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema ddls145 cascade;" + psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema if exists ddls145 cascade;" echo "Dropping the ddls330 schema" - psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema ddls330 cascade;" + psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema if exists ddls330 cascade;" echo "Dropping the audit schema" - psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema audit cascade;" + psql $POSTGRES_HOST_OPTS -d $POSTGRES_DATABASE -c "drop schema if exists audit cascade;" fi echo "Restoring ${LATEST_BACKUP}"