#27858: Stop read-only management commands from attempting to create a
django_migrations table
-------------------------------------+-------------------------------------
     Reporter:  Marti Raudsepp       |                    Owner:  Marti
         Type:                       |  Raudsepp
  Cleanup/optimization               |                   Status:  assigned
    Component:  Migrations           |                  Version:  1.10
     Severity:  Normal               |               Resolution:
     Keywords:  makemigrations       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * cc: Andrew Godwin (removed)
 * stage:  Unreviewed => Accepted
 * type:  New feature => Cleanup/optimization


Old description:

> In multiple different projects now, I've needed to connect Django to
> legacy databases that aren't under Django's control. Even when setting
> "manage = False" in all affected models and configuring the DB router to
> never allow migrate in the legacy database, Django "makemigrations" still
> attempts to create the django_migrations table, causing permission errors
> in my use case.
>
> The pull request changes MigrationRecorder is so that for read-only
> operations, if the django_migrations table doesn't exist, it's assumed
> that no migrations have been applied, instead of trying to create it.
> This applies to all migration commands.
>
> Django has always had the problem of being "opinionated", meaning there's
> often fighting involved if you don't exactly follow The True Django Way.
> :) This patch is a small step in making Django more flexible.
>
> ~~PS: I understand that version 1.11 is already in a feature freeze, but
> is there aaaaany chance of getting this patch in there?~~

New description:

 In multiple different projects now, I've needed to connect Django to
 legacy databases that aren't under Django's control. Even when setting
 "manage = False" in all affected models and configuring the DB router to
 never allow migrate in the legacy database, Django "makemigrations" still
 attempts to create the django_migrations table, causing permission errors
 in my use case.

 The pull request changes MigrationRecorder is so that for read-only
 operations, if the django_migrations table doesn't exist, it's assumed
 that no migrations have been applied, instead of trying to create it. This
 applies to all migration commands.

 Django has always had the problem of being "opinionated", meaning there's
 often fighting involved if you don't exactly follow The True Django Way.
 :) This patch is a small step in making Django more flexible.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/27858#comment:6>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/063.472a3fb335c96917fd499d3760c1d304%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to