From 79bbb248bb522d0c574bd43dae72d53eacf42409 Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Sat, 14 Sep 2024 18:29:04 +1000 Subject: [PATCH] Update `make up` to automatically initialise the db (#7161) It does this by (very quickly) checking if the organization table is present, running `make create_database` if not. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 404bfc10e1..1eada4b3d5 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ compose_build: .env COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose build 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: