Changes between Initial Version and Version 1 of Ticket #27054, comment 7


Ignore:
Timestamp:
08/12/2016 08:29:31 PM (5 years ago)
Author:
Jim Nicholls
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27054, comment 7

    initial v1  
    11I think I've missed the obvious.
    22
    3 `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.
     3`applied_migrations` is calling `ensure_schema` just to avoid a `DatabaseError` when it calls `Migration.objects.values_list`. For me the call to `ensure_schema` has unwanted the side-effect of trying to create the `django_migrations` table, which is causing my problem.
    44
    5 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.
     5Maybe it would better to not call `ensure_schema` at all, but instead catch the `DatabaseError` that is going to happen if there is no `django_migrations` table and then return an empty set.
    66
    77`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.
Back to Top