Opened 10 years ago

Closed 10 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 Tim Graham, 10 years ago

Component: Uncategorized → GIS
Type: Uncategorized → Bug

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.

comment:2 by Tim Graham, 10 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:3 by Alex Rothberg, 10 years ago

yes, this fixed the issue I was observing.

comment:4 by Claude Paroz, 10 years ago

Triage Stage: Accepted → Ready for checkin

comment:5 by GitHub <noreply@…>, 10 years ago

Resolution: → fixed
Status: new → closed

In 953629b:

Fixed #27072 -- Fixed AddGeometryColumn error when altering a SpatiaLite table.

Note: See TracTickets for help on using tickets.
Back to Top