# Generated by Django 3.2.7 on 2021-10-26 18:45

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('geo', '0003_adminregion_in_extent'),
    ]

    operations = [
        migrations.CreateModel(
            name='SubRegionRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geog_type', models.CharField(choices=[('Block group', 'blockGroup'), ('Tract', 'tract'), ('County subdivision', 'countySubdivision'), ('Place', 'place'), ('Puma', 'puma'), ('School district', 'schoolDistrict'), ('State house', 'stateHouse'), ('State senate', 'stateSenate'), ('County', 'county'), ('Zip Code Tab. Area (Zip Code)', 'zcta'), ('Pgh Neighborhood', 'neighborhood')], max_length=64)),
                ('admin_region', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='region_to_subregion', to='geo.adminregion')),
                ('child_regions', models.ManyToManyField(related_name='sub_region_to_region', to='geo.AdminRegion')),
            ],
            options={
                'unique_together': {('geog_type', 'admin_region')},
            },
        ),
        migrations.AddField(
            model_name='adminregion',
            name='child_geogs',
            field=models.ManyToManyField(through='geo.SubRegionRelation', to='geo.AdminRegion'),
        ),
    ]
