Opened 8 years ago
Closed 8 years ago
#27072 closed Bug (fixed)
AddGeometryColumn: “duplicate column name: xxx” error running migrations on SpatiaLite
Reported by: | Alex Rothberg | Owned by: | nobody |
---|---|---|---|
Component: | GIS | Version: | 1.10 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is a repost of SO question. The issue still seems to occur in Django 1.9 when using the built in migrations.
For example, when running tests I see (I have a column named capture_location
of type PointField
):
Creating test database for alias 'default'... AddGeometryColumn: "duplicate column name: capture_location" ... repeated many times AddGeometryColumn: "duplicate column name: capture_location" Destroying test database for alias 'default'...
(note that tests and server run without a problem)
Change History (5)
comment:1 by , 8 years ago
Component: | Uncategorized → GIS |
---|---|
Type: | Uncategorized → Bug |
comment:2 by , 8 years ago
Has patch: | set |
---|---|
Summary: | geodjango with migrations causes “duplicate collumn name error” with spatialight db → AddGeometryColumn: “duplicate column name: xxx” error running migrations on SpatiaLite |
Triage Stage: | Unreviewed → Accepted |
A little research suggests SELECT RecoverGeometryColumn
should be used to recreate the geometry-ness of a column that had its geometry data discarded. My PR fixes the errors that are displayed while running Django's test suite. Can you check the patch with your project? I'm not sure if additional tests are required.
comment:4 by , 8 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
I'm not sure the cause or resolution, but that error output also happens when running Django's test suite on SpatiaLite:
$ ./tests/runtests.py gis_tests.gis_migrations
.