﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22001	GeoDjango (contrib.gis) does not create geometry columns in 1.7a2	Stefano Costa	Eric Palakovich Carr	"I am testing Django 1.7a2 on a very small project+app.

So far, with both PostGIS and SpatiaLite I have found the following problem. Basically the geometry column is included in the migration.py file, but not in the SQL migration. 

models.py:


{{{
from django.contrib.gis.db import models

# Create your models here.

class Location(models.Model):
    name = models.CharField(max_length=100)
    geom = models.PointField(srid=2100)
    objects = models.GeoManager()

    def __unicode__(self):
        return self.name

}}}

0001 myapp/0001_initial.py:

{{{
# encoding: utf8
from django.db import models, migrations
import django.contrib.gis.db.models.fields


class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Location',
            fields=[
                (u'id', models.AutoField(verbose_name=u'ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=100)),
                ('geom', django.contrib.gis.db.models.fields.PointField(srid=2100)),
            ],
            options={
            },
            bases=(models.Model,),
        ),
    ]
}}}

Output from sqlmigrate:

{{{
(venv)[steko@ogma myproject]$ python manage.py sqlmigrate myapp 0001
CREATE TABLE ""myapp_location"" (""id"" integer NOT NULL PRIMARY KEY AUTOINCREMENT, ""name"" varchar(100) NOT NULL);
}}}

This happens both with PostGIS and SpatiaLite. Perhaps obvious: it works well with Django 1.6. My current system is Fedora 20."	Bug	closed	GIS	dev	Release blocker	fixed		Eric Palakovich Carr django@…	Accepted	0	0	0	0	0	0
