Private
Public Access
1
0

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 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-26 19:46:14 -05:00
parent 5f552a9883
commit 04f5786cf6
+6 -3
View File
@@ -20,22 +20,25 @@ if [ $RETRY -ge $MAX_RETRIES ]; then
exit 1 exit 1
fi 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..." 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." echo "Collation fix applied successfully."
else else
echo "WARNING: Failed to apply collation fix. Continuing anyway..." echo "WARNING: Failed to apply collation fix. Continuing anyway..."
fi fi
echo "Applying RLS policies..." 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." echo "RLS policies applied successfully."
else else
echo "WARNING: Failed to apply RLS policies. Continuing anyway..." echo "WARNING: Failed to apply RLS policies. Continuing anyway..."
fi fi
echo "Applying full-text search indexes..." 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." echo "Search indexes applied successfully."
else else
echo "WARNING: Failed to apply search indexes. Continuing anyway..." echo "WARNING: Failed to apply search indexes. Continuing anyway..."