Changes between Initial Version and Version 1 of Ticket #27054, comment 7
- Timestamp:
- Aug 12, 2016, 8:29:31 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27054, comment 7
initial v1 1 1 I think I've missed the obvious. 2 2 3 `applied_migrations` is calling `ensure_schema` just to avoid a `DatabaseError` when it calls `Migration.objects.values_list`. For m y the call to `ensure_schema` has unwanted side-effect and causes aproblem.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. 4 4 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.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 `django_migrations` table and then return an empty set. 6 6 7 7 `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.