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.
This commit is contained in:
sankalp committed 2026-06-28 18:24:28 +05:45
1 parent 04e0d032b7
commit 8d61792a3f
1 file changed
+3
+3
View File
@@ -30,6 +30,7 @@ migrate:
# Reset database (delete all migrations) # Reset database (delete all migrations)
reset-db: reset-db:
uv run python manage.py flush --noinput uv run python manage.py flush --noinput
uv run python manage.py makemigrations
uv run python manage.py migrate uv run python manage.py migrate
# Create superuser # Create superuser
@@ -207,6 +208,7 @@ pin-deps:
setup: setup:
uv sync uv sync
just pin-deps just pin-deps
uv run python manage.py makemigrations
uv run python manage.py migrate uv run python manage.py migrate
uv run python manage.py createcachetable uv run python manage.py createcachetable
uv run python manage.py createsuperuser uv run python manage.py createsuperuser
@@ -214,6 +216,7 @@ setup:
# Complete setup including static files # Complete setup including static files
setup-complete: setup-complete:
uv sync uv sync
uv run python manage.py makemigrations
uv run python manage.py migrate uv run python manage.py migrate
uv run python manage.py createcachetable uv run python manage.py createcachetable
uv run python manage.py collectstatic --noinput uv run python manage.py collectstatic --noinput