#36129: Geodjango migrations ignore change of dimension in MultiPointField
------------------------------+--------------------------------------
     Reporter:  Paweł Kotiuk  |                    Owner:  (none)
         Type:  Bug           |                   Status:  closed
    Component:  GIS           |                  Version:  dev
     Severity:  Normal        |               Resolution:  invalid
     Keywords:  migrations    |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------
Comment (by Paweł Kotiuk):

 Hello Natalia, thank you for quick response.
 Originally I discovered this bug, when I wanted to decrease number of
 dimensions, and I was surprised that every single unit test in my test
 suite failed. And generated migration (even for database generated from
 scratch) always fails with: `ValueError: Cannot alter field...`

 > Can you specify what backend are you using?

 My database backend is `django.contrib.gis.db.backends.spatialite`

 > in that how the added dimension would work with respect to the existing
 values in the DB?

 **For now migration breaks entire database, even when it is recreated from
 scratch only for tests. **
 I think it should work in the same way as migration for providing new
 required value for model. So we should at least get a prompt asking about
 default value we want to use.

 > it seems quite challenging to generate a migration that makes sense for
 the backend

 In case of migration from 2 to 3 dimensions yes, but in case of migrating
 from 3 dimensions to 2 it should be rather simple. Just delete Z axis.
 **I think , that at least this single case should be somehow tackled (and
 in other cases some warning should be shown).**


 ----

 I think this issue should be reopened, because it causes unexpected
 problems with django project by generating broken migrations and it should
 be somehow tackled. Either by providing reliable migration mechanism or at
 least by showing warning during migration or generating migration files.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36129#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 view this discussion visit 
https://groups.google.com/d/msgid/django-updates/01070194980fc097-be20a86f-df11-4f3d-9ab4-9e650cb9d28b-000000%40eu-central-1.amazonses.com.

Reply via email to