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:
1 file changed
+3
@@ -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
|
||||
|
||||
Reference in new issue
Block a user