#33421: Skip consistency checks on makemigrations
-------------------------------------+-------------------------------------
Reporter: Tim | Owner: nobody
Nyborg |
Type: New | Status: new
feature |
Component: | Version: 4.0
Migrations | Keywords: makemigrations
Severity: Normal | databases
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------+-------------------------------------
During CI/CD, it's very useful to run `makemigrations --check --dry-run`
to see if migrations have not been created for model changes. Problem is,
`makemigrations` will do migration history consitency checks on the
default database, which won't exist if you're trying to make a lightweight
CI stage.
You can work around this by (for example):
1. Creating a separate settings file that uses the dummy backend for
`DATABASES['default']`
2. Using an env variable to switch to the dummy backend in your settings
file
3. Setting up database routers which disallow migration
But these are all awkward and potentially fragile, adding logic to an
application's core.
I'd suggest adding a `--skip-consistency-checks` flag which simply skips
that
[https://github.com/django/django/blob/0ab58c120939093fea90822f376e1866fc714d1f/django/core/management/commands/makemigrations.py#L93-L113
section].
If this'd be acceptable, I'd be happy to put together a pull request.
--
Ticket URL: <https://code.djangoproject.com/ticket/33421>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.e3ce80375df1256fb925ac376778c5ce%40djangoproject.com.