In Django, there's no official --force
flag for makemigrations
, but here are equivalent ways to forcefully regenerate migrations:
✅ Option 1: Delete old migrations, then regenerate
This is the cleanest way to "force" new migrations:
Step 1: Delete existing migration files
For example, for the app fundraiser
:
find fundraiser/migrations/ -not -name "__init__.py" -delete
Repeat for other apps (common
, payment
, etc.).
Or in Windows Git Bash:
find fundraiser/migrations/ ! -name "__init__.py" -type f -delete
Step 2: Re-run makemigrations
python manage.py makemigrations
Now Django will re-scan all models and generate fresh migrations as if from scratch.
✅ Option 2: Use --empty
if you just need a placeholder
python manage.py makemigrations fundraiser --empty
This doesn't inspect models, but gives you a blank migration file to edit manually (useful when Django doesn't detect changes).
✅ Option 3: Fake a clean slate
If you've already reset the database manually (e.g., dropped tables), and want Django to "believe" everything is in sync:
python manage.py migrate --fake
Or after zeroing out:
python manage.py migrate appname zero --fake
python manage.py migrate appname --fake-initial
⚠️ Be careful
- Forcing migrations can break existing data.
- Only do this if you're in development or know how to handle schema/data resets.
Top comments (0)