From 8d61792a3fc264b9740a3b6c70697f473baf2d31 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Sun, 28 Jun 2026 18:24:28 +0545 Subject: [PATCH] fix(justfile): add makemigrations before migrate in setup/reset-db When migrations are not committed (src/*/migrations/ is gitignored), running 'just setup' skips makemigrations and goes straight to migrate. Without migration files, admin.0001_initial's swappable_dependency to accounts becomes a no-op, causing InconsistentMigrationHistory errors when makemigrations is run later. Fix by adding makemigrations to setup, setup-complete, and reset-db targets so migrations are always generated before being applied. --- justfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/justfile b/justfile index 58a5f89..821cb08 100644 --- a/justfile +++ b/justfile @@ -30,6 +30,7 @@ migrate: # Reset database (delete all migrations) reset-db: uv run python manage.py flush --noinput + uv run python manage.py makemigrations uv run python manage.py migrate # Create superuser @@ -207,6 +208,7 @@ pin-deps: setup: uv sync just pin-deps + uv run python manage.py makemigrations uv run python manage.py migrate uv run python manage.py createcachetable uv run python manage.py createsuperuser @@ -214,6 +216,7 @@ setup: # Complete setup including static files setup-complete: uv sync + uv run python manage.py makemigrations uv run python manage.py migrate uv run python manage.py createcachetable uv run python manage.py collectstatic --noinput