From 1a1d3a61350c4ed8b2092bfd2d80e79134a9ae94 Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Sun, 7 Apr 2024 21:55:38 +1000 Subject: [PATCH] Much faster check if the database has been seeded --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 919cbfaae7..1eada4b3d5 100644 --- a/Makefile +++ b/Makefile @@ -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: