#23966: Doing pre-migrate database requirements
-------------------------------------+-------------------------------------
     Reporter:  kenial               |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  1.7
    Component:  Database layer       |               Resolution:
  (models, ORM)                      |             Triage Stage:
     Severity:  Normal               |  Unreviewed
     Keywords:  migrate              |      Needs documentation:  0
  BaseDatabaseWrapper spatialite     |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Description changed by kenial:

Old description:

> Some database backends has special requirements when the database gets
> migrated.
>
> For example, when using django.contrib.gis.db.backends.spatialite as a
> backend, the database file should be initialized at first time with this
> command: `"SELECT InitSpatialMetaData();"` Unless, it causes some error
> like https://code.djangoproject.com/ticket/20968.
>
> I guess this would be appropriate: adding a before_migration() method to
> DatabaseWrapper, and letting database backends inherit it to do some
> jobs.

New description:

 Some database backends has special requirements when the database gets
 migrated.

 For example, when using django.contrib.gis.db.backends.spatialite as a
 backend, the database file should be initialized at first time with this
 command: `"SELECT InitSpatialMetaData();"` Unless, it causes some error
 like https://code.djangoproject.com/ticket/20968.

 ~~I guess this would be appropriate: adding a before_migration() method to
 DatabaseWrapper, and letting database backends inherit it to do some
 jobs.~~

 New workaround codes are added to django/contrib/gis/apps.py. (Thanks
 @aaugustin!)

 Pull request link: https://github.com/django/django/pull/3695

--

--
Ticket URL: <https://code.djangoproject.com/ticket/23966#comment:3>
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/064.b9b9ecf4b4d3254f334f56d7dc695cb5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to