From 04f5786cf69bf118994df664fd5b3cb991342f84 Mon Sep 17 00:00:00 2001 From: Catherine Renelle <32781029+catrenelle@users.noreply.github.com> Date: Thu, 26 Feb 2026 19:46:14 -0500 Subject: [PATCH] Fix psql URI in entrypoint: strip Prisma query params psql doesn't understand ?schema=public in the DATABASE_URL. Strip query parameters before passing to psql for RLS, collation, and search index scripts. Co-Authored-By: Claude Opus 4.6 --- docker-entrypoint.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 758386a..2f67c04 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -20,22 +20,25 @@ if [ $RETRY -ge $MAX_RETRIES ]; then exit 1 fi +# Strip Prisma-specific query params (e.g. ?schema=public) that psql doesn't understand +PSQL_URL="${DATABASE_URL%%\?*}" + echo "Applying position column collation fix..." -if psql "$DATABASE_URL" -f ./scripts/setup-collation.sql; then +if psql "$PSQL_URL" -f ./scripts/setup-collation.sql; then echo "Collation fix applied successfully." else echo "WARNING: Failed to apply collation fix. Continuing anyway..." fi echo "Applying RLS policies..." -if psql "$DATABASE_URL" -f ./scripts/setup-rls.sql; then +if psql "$PSQL_URL" -f ./scripts/setup-rls.sql; then echo "RLS policies applied successfully." else echo "WARNING: Failed to apply RLS policies. Continuing anyway..." fi echo "Applying full-text search indexes..." -if psql "$DATABASE_URL" -f ./scripts/setup-search.sql; then +if psql "$PSQL_URL" -f ./scripts/setup-search.sql; then echo "Search indexes applied successfully." else echo "WARNING: Failed to apply search indexes. Continuing anyway..."