Skip to content

Commit

Permalink
fix: trim whitespace on schema check prior to migrate (#886)
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock authored Oct 8, 2023
1 parent dd405ce commit 1e2bd7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/migrate-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ create_db_schema_if_missing() {
table_exists=$(psql -t "$db_url" -c "
SELECT EXISTS (SELECT 1 FROM information_schema.tables
WHERE table_schema = 'public' AND table_name = 'projects');
")

" | tr -d '[:space:]') # Remove all whitespace and formatting characters
echo "Debug: return from table_exists query: $table_exists"

if [ "$table_exists" = "t" ]; then
echo "Data exists in the database. Skipping schema creation."
return 0
Expand Down

0 comments on commit 1e2bd7b

Please sign in to comment.