From b3779b5979a88218204b7676b023d5012e2c3c44 Mon Sep 17 00:00:00 2001 From: Sabrina Demagny Date: Mon, 3 Jun 2024 17:08:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB(makefile)=20i?= =?UTF-8?q?mprove=20django=20migration=20commands?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add showmigrations command. Allow to pass args to migrate and makemigrations commands. --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3ce4ea2..bcd8277 100644 --- a/Makefile +++ b/Makefile @@ -166,21 +166,27 @@ test-back-parallel: ## run all back-end tests in parallel bin/pytest -n auto $${args:-${1}} .PHONY: test-back-parallel - makemigrations: ## run django makemigrations for the people project. @echo "$(BOLD)Running makemigrations$(RESET)" @$(COMPOSE) up -d postgresql @$(WAIT_DB) - @$(MANAGE) makemigrations + @$(MANAGE) makemigrations $(ARGS) .PHONY: makemigrations migrate: ## run django migrations for the people project. @echo "$(BOLD)Running migrations$(RESET)" @$(COMPOSE) up -d postgresql @$(WAIT_DB) - @$(MANAGE) migrate + @$(MANAGE) migrate $(ARGS) .PHONY: migrate +showmigrations: ## run django showmigrations for the people project. + @echo "$(BOLD)Running showmigrations$(RESET)" + @$(COMPOSE) up -d postgresql + @$(WAIT_DB) + @$(MANAGE) showmigrations $(ARGS) +.PHONY: showmigrations + superuser: ## Create an admin superuser with password "admin" @echo "$(BOLD)Creating a Django superuser$(RESET)" @$(MANAGE) createsuperuser --admin_email admin@example.com --password admin