File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,15 @@ echo "${_group}Setting up / migrating database ..."
22
33# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
44$dc up -d postgres
5- timeout 90s bash -c " until $dc exec postgres pg_isready ; do sleep 5 ; done"
5+ # Wait for postgres
6+ RETRIES=5
7+ until $dc exec postgres psql -U postgres -c " select 1" > /dev/null 2>&1 || [ $RETRIES -eq 0 ]; do
8+ echo " Waiting for postgres server, $(( RETRIES-- )) remaining attempts..."
9+ sleep 1
10+ done
611indexes=$( $dc exec postgres psql -qAt -U postgres -c " SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'sentry_groupedmessage';" )
712if [[ $indexes == * " sentry_groupedmessage_project_id_id_515aaa7e_uniq" * ]]; then
8- $dc postgres psql -qAt -U postgres -c " DROP INDEX sentry_groupedmessage_project_id_id_515aaa7e_uniq;"
13+ $dc exec postgres psql -qAt -U postgres -c " DROP INDEX sentry_groupedmessage_project_id_id_515aaa7e_uniq;"
914fi
1015
1116if [[ -n " ${CI:- } " || " ${SKIP_USER_CREATION:- 0} " == 1 ]]; then
You can’t perform that action at this time.
0 commit comments