Skip to content

Commit

Permalink
Update make up to automatically initialise the db (getredash#7161)
Browse files Browse the repository at this point in the history
It does this by (very quickly) checking if the organization table
is present, running `make create_database` if not.
  • Loading branch information
justinclift authored Sep 14, 2024
1 parent 5cf0b7b commit 79bbb24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 79bbb24

Please sign in to comment.