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

Component: UncategorizedGIS
Type: UncategorizedBug

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, 8 years ago

Has patch: set
Summary: geodjango with migrations causes “duplicate collumn name error” with spatialight dbAddGeometryColumn: “duplicate column name: xxx” error running migrations on SpatiaLite
Triage Stage: UnreviewedAccepted

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, 8 years ago

yes, this fixed the issue I was observing.

comment:4 by Claude Paroz, 8 years ago

Triage Stage: AcceptedReady for checkin

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

Resolution: fixed
Status: newclosed

In 953629b:

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

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