2015-01-28 20:35:27 +08:00
|
|
|
from django.db import migrations, models
|
2014-03-15 06:18:20 +08:00
|
|
|
|
2015-04-05 00:09:46 +08:00
|
|
|
from ...models import models as gis_models
|
|
|
|
|
2014-03-15 06:18:20 +08:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
2014-07-16 17:06:33 +08:00
|
|
|
"""
|
|
|
|
Used for gis.specific migration tests.
|
|
|
|
"""
|
2014-03-15 06:18:20 +08:00
|
|
|
operations = [
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Neighborhood',
|
|
|
|
fields=[
|
2014-03-15 20:47:32 +08:00
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2014-03-19 08:39:14 +08:00
|
|
|
('name', models.CharField(max_length=100, unique=True)),
|
2015-04-05 00:09:46 +08:00
|
|
|
('geom', gis_models.MultiPolygonField(srid=4326)),
|
2014-03-15 06:18:20 +08:00
|
|
|
],
|
|
|
|
options={
|
2015-04-05 00:09:46 +08:00
|
|
|
'required_db_features': ['gis_enabled'],
|
2014-03-15 06:18:20 +08:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
|
|
|
),
|
|
|
|
migrations.CreateModel(
|
|
|
|
name='Household',
|
|
|
|
fields=[
|
2014-03-15 20:47:32 +08:00
|
|
|
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
2014-10-11 22:30:45 +08:00
|
|
|
('neighborhood', models.ForeignKey(to='gis_migrations.Neighborhood', to_field='id', null=True)),
|
2014-03-19 08:39:14 +08:00
|
|
|
('address', models.CharField(max_length=100)),
|
2014-03-15 06:18:20 +08:00
|
|
|
('zip_code', models.IntegerField(null=True, blank=True)),
|
2015-04-05 00:09:46 +08:00
|
|
|
('geom', gis_models.PointField(srid=4326, geography=True)),
|
2014-03-15 06:18:20 +08:00
|
|
|
],
|
|
|
|
options={
|
2015-04-05 00:09:46 +08:00
|
|
|
'required_db_features': ['gis_enabled'],
|
2014-03-15 06:18:20 +08:00
|
|
|
},
|
|
|
|
bases=(models.Model,),
|
2014-07-16 17:06:33 +08:00
|
|
|
),
|
|
|
|
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',
|
2014-10-11 22:30:45 +08:00
|
|
|
field=models.ForeignKey(blank=True, to='gis_migrations.Family', null=True),
|
2014-07-16 17:06:33 +08:00
|
|
|
preserve_default=True,
|
|
|
|
),
|
2014-03-15 06:18:20 +08:00
|
|
|
]
|