Skip to content

Commit 2346a69

Browse files
Fix groupedmessage indexing error (#2777)
* fix groupedmessage indexing error
1 parent de9f52f commit 2346a69

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

install/set-up-and-migrate-database.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
echo "${_group}Setting up / migrating database ..."
22

3+
# Fixes https://github.com/getsentry/self-hosted/issues/2758, where a migration fails due to indexing issue
4+
$dc up -d postgres
5+
timeout 90s bash -c "until $dc exec postgres pg_isready ; do sleep 5 ; done"
6+
indexes=$($dc exec postgres psql -qAt -U postgres -c "SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'sentry_groupedmessage';")
7+
if [[ $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;"
9+
fi
10+
311
if [[ -n "${CI:-}" || "${SKIP_USER_CREATION:-0}" == 1 ]]; then
412
$dcr web upgrade --noinput
513
echo ""

0 commit comments

Comments
 (0)