Skip to content

Commit 21c2a20

Browse files
alexhookAlexander Maximenyuk
andauthored
feat: Action to remove all DB connections before database dropping (#17)
Co-authored-by: Alexander Maximenyuk <[email protected]>
1 parent d875493 commit 21c2a20

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.gitlab-ci.yml.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ deploy.botstest.stop:
147147
extends: deploy.botstest
148148
script:
149149
- docker rm -f ${CONTAINER_NAME} || true
150+
- psql -c "select pg_terminate_backend(pid) from pg_stat_activity \
151+
where datname = '${POSTGRES_DB}';" postgres || true
150152
- psql -c "drop database \"${POSTGRES_DB}\"" postgres || true
151153
- psql -c "drop user \"${POSTGRES_USER}\"" postgres || true
152154

0 commit comments

Comments
 (0)