#27054: makemigrations tries to create django_migrations in external database
--------------------------------------+------------------------------------
     Reporter:  SydneyUniLibrary-Jim  |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Migrations            |                  Version:  1.10
     Severity:  Release blocker       |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  1                     |      Needs documentation:  0
  Needs tests:  1                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by SydneyUniLibrary-Jim):

 I think I've missed the obvious.

 `applied_migrations` is calling `ensure_schema` just to avoid a
 `DatabaseError` when it calls `Migration.objects.values_list`. For my the
 call to `ensure_schema` has unwanted side-effect and causes a problem.

 Maybe it would better to not call `ensure_schema` at all, but instead
 catch the `DatabaseError` that is going to happen if there is no ``` table
 and then return an empty set.

 `MigrationRecorder.record_applied` and
 `MigrationRecorder.record_unapplied` both call `ensure_schema` themselves.
 This would mean that the `django_migrations` table would be created at the
 point when a migration is actually to being applied. At that point, if the
 `django_migrations` table cannot be created, that is an exceptional
 circumstance.

--
Ticket URL: <https://code.djangoproject.com/ticket/27054#comment:7>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/078.3b89b6d979453785f6c5f46eaa5ef7ed%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to