mirror of
https://github.com/django/django.git
synced 2024-11-18 07:26:04 +00:00
51 lines
1.9 KiB
Python
51 lines
1.9 KiB
Python
import django.contrib.gis.db.models.fields
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
"""
|
|
Used for gis.specific migration tests.
|
|
"""
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Neighborhood',
|
|
fields=[
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
('name', models.CharField(max_length=100, unique=True)),
|
|
('geom', django.contrib.gis.db.models.fields.MultiPolygonField(srid=4326)),
|
|
],
|
|
options={
|
|
},
|
|
bases=(models.Model,),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Household',
|
|
fields=[
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
('neighborhood', models.ForeignKey(to='gis_migrations.Neighborhood', to_field='id', null=True)),
|
|
('address', models.CharField(max_length=100)),
|
|
('zip_code', models.IntegerField(null=True, blank=True)),
|
|
('geom', django.contrib.gis.db.models.fields.PointField(srid=4326, geography=True)),
|
|
],
|
|
options={
|
|
},
|
|
bases=(models.Model,),
|
|
),
|
|
migrations.CreateModel(
|
|
name='Family',
|
|
fields=[
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
|
('name', models.CharField(max_length=100, unique=True)),
|
|
],
|
|
options={
|
|
},
|
|
bases=(models.Model,),
|
|
),
|
|
migrations.AddField(
|
|
model_name='household',
|
|
name='family',
|
|
field=models.ForeignKey(blank=True, to='gis_migrations.Family', null=True),
|
|
preserve_default=True,
|
|
),
|
|
]
|