#31693: disabling migrations and postgresql extensions don't mix well
-------------------------------------+-------------------------------------
               Reporter:  Markus     |          Owner:  nobody
  Bertheau                           |
                   Type:             |         Status:  new
  Cleanup/optimization               |
              Component:  Database   |        Version:  master
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 In [https://code.djangoproject.com/ticket/25388 #25388] a
 [https://docs.djangoproject.com/en/dev/ref/settings/#migrate feature] was
 introduced to disable migrations for test databases. Before that it was
 possible to disable migrations for all apps with MIGRATION_MODULES,
 mapping every app to `None`
 ([https://docs.djangoproject.com/en/dev/ref/settings/#migration-modules as
 explained here]). Other code is used for example in pytest-django
 ([https://github.com/pytest-dev/pytest-
 
django/blob/ee7858af1a80e0091af4d260c0a70e5766c1196a/pytest_django/migrations.py
 here] and [https://github.com/pytest-dev/pytest-
 
django/blob/ee7858af1a80e0091af4d260c0a70e5766c1196a/pytest_django/fixtures.py#L156-L169
 here]) to disable migrations in other ways. All for the speed-up in
 creating a database "directly" (circumventing migrations) as opposed to
 creating it with the migration mechanism.

 Also, [https://docs.djangoproject.com/en/dev/ref/databases/#migration-
 operation-for-adding-extensions here] and
 [https://docs.djangoproject.com/en/dev/ref/contrib/postgres/operations
 /#creating-extension-using-migrations here] it is explained how extensions
 should be installed with a migration operation.

 Both don't mix, because when disabling migrations, the extension doesn't
 get installed. Using features of the extension, for example column types,
 doesn't work.

 As a side note: postgis functionality is provided through a separate
 database engine that provides its own `DatabaseWrapper` that takes care of
 installing the postgis extension, independent of the migration mechanism.

 Maybe extensions should be configured in settings.DATABASES and then
 automatically installed by the postgresql engine.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31693>
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.55a6de946736d8d73407ea474725b103%40djangoproject.com.

Reply via email to