Code

Opened 5 years ago

Closed 4 years ago

Last modified 3 years ago

#11969 closed (fixed)

Syncdb doesn't honor managed=False setting with Geodjango

Reported by: jtiai Owned by: nobody
Component: GIS Version: master
Severity: Keywords:
Cc: ikelly, mboersma Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Geodjango "geomanager" based models do not honor "managed = False" setting but tries to forcefully create spatial index and insert spatial metadata in Oracle.

Attachments (0)

Change History (6)

comment:1 Changed 5 years ago by mal

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

It seems to happen when model (with spatial field) is based on the view.

When model points to the normal table (via db_table = 'my table') syncdb works alright (obeying "managed = False"), when it points to the view then syncdb keeps trying to install it, including attempts to create spatial medatada and spatial indexes.

Installing custom SQL for myapp.mymodel model
Failed to install custom SQL for myapp.mymodel model: ORA-13223: duplicate entry for <mytable>.location in SDO_GEOM_METADATA
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 17
ORA-06512: at "MDSYS.SDO_GEOM_TRIG_INS1", line 48
ORA-04088: error during execution of trigger 'MDSYS.SDO_GEOM_TRIG_INS1'

comment:2 Changed 5 years ago by ikelly

  • Cc ikelly, mboersma added

comment:3 Changed 4 years ago by jbronn

  • Keywords oracle removed
  • milestone set to 1.2
  • Summary changed from Syncdb doesn't honor managed=False setting with Oracle and Geodjango to Syncdb doesn't honor managed=False setting with Geodjango

This is currently fixed in trunk, because GeometryField no longer uses the post_create_sql hook. However, for API consistency I will commit a fix for the post_create_sql hook to both trunk and 1.1.X (which is still affected). Moreover, this is not an Oracle-specific bug, as it affects all backends.

comment:4 Changed 4 years ago by jbronn

  • Resolution set to fixed
  • Status changed from new to closed

(In [12313]) Fixed #11969 -- Field.post_create_sql hook should not be called for unmanaged models. Thanks, jtiai for report.

comment:5 Changed 4 years ago by jbronn

(In [12314]) [1.1.X] Fixed #11969 -- Field.post_create_sql hook should not be called for unmanaged models. Thanks, jtiai for report.

Backport of r12313 from trunk.

comment:6 Changed 3 years ago by jacob

  • milestone 1.2 deleted

Milestone 1.2 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.