Skip to content

Commit

Permalink
Much faster check if the database has been seeded
Browse files Browse the repository at this point in the history
  • Loading branch information
justinclift committed Apr 7, 2024
1 parent c3b51e5 commit 1a1d3a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
compose_build: .env
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build

up: create_database
up:
docker compose up -d redis postgres
docker compose exec -u postgres postgres psql postgres --csv \
-1tqc "SELECT table_name FROM information_schema.tables WHERE table_name = 'organizations'" 2> /dev/null \
| grep -q "organizations" || make create_database
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose up -d --build

test_db:
Expand Down

0 comments on commit 1a1d3a6

Please sign in to comment.