# Generated by Django 3.2.8 on 2022-10-03 20:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('iranian_cities', '0004_remove_abadi_shhahr'),
    ]

    operations = [
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
                ('city_type', models.IntegerField(verbose_name='City Type')),
            ],
            options={
                'verbose_name': 'City',
                'verbose_name_plural': 'Cities',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='County',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
            ],
            options={
                'verbose_name': 'County',
                'verbose_name_plural': 'Counties',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
                ('county', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='districts', to='iranian_cities.county', verbose_name='County')),
            ],
            options={
                'verbose_name': 'District',
                'verbose_name_plural': 'Districts',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
            ],
            options={
                'verbose_name': 'Province',
                'verbose_name_plural': 'Provinces',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='RuralDistrict',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
                ('county', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ruraldistricts', to='iranian_cities.county', verbose_name='County')),
                ('district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ruraldistricts', to='iranian_cities.district', verbose_name='District')),
                ('province', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ruraldistricts', to='iranian_cities.province', verbose_name='Province')),
            ],
            options={
                'verbose_name': 'Rural District',
                'verbose_name_plural': 'Rural Districts',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='Village',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('code', models.BigIntegerField(verbose_name='Code')),
                ('village_type', models.IntegerField(verbose_name='Village Type')),
                ('county', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='villages', to='iranian_cities.county', verbose_name='County')),
                ('district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='villages', to='iranian_cities.district', verbose_name='District')),
                ('province', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='villages', to='iranian_cities.province', verbose_name='Province')),
                ('rural_district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='villages', to='iranian_cities.ruraldistrict', verbose_name='Rural District')),
            ],
            options={
                'verbose_name': 'Village',
                'verbose_name_plural': 'Villages',
                'ordering': ('id',),
            },
        ),
        migrations.RemoveField(
            model_name='bakhsh',
            name='ostan',
        ),
        migrations.RemoveField(
            model_name='bakhsh',
            name='shahrestan',
        ),
        migrations.RemoveField(
            model_name='dehestan',
            name='bakhsh',
        ),
        migrations.RemoveField(
            model_name='dehestan',
            name='ostan',
        ),
        migrations.RemoveField(
            model_name='dehestan',
            name='shahrestan',
        ),
        migrations.RemoveField(
            model_name='shahr',
            name='bakhsh',
        ),
        migrations.RemoveField(
            model_name='shahr',
            name='ostan',
        ),
        migrations.RemoveField(
            model_name='shahr',
            name='shahrestan',
        ),
        migrations.RemoveField(
            model_name='shahrestan',
            name='ostan',
        ),
        migrations.DeleteModel(
            name='Abadi',
        ),
        migrations.DeleteModel(
            name='Bakhsh',
        ),
        migrations.DeleteModel(
            name='Dehestan',
        ),
        migrations.DeleteModel(
            name='Ostan',
        ),
        migrations.DeleteModel(
            name='Shahr',
        ),
        migrations.DeleteModel(
            name='Shahrestan',
        ),
        migrations.AddField(
            model_name='district',
            name='province',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='districts', to='iranian_cities.province', verbose_name='Province'),
        ),
        migrations.AddField(
            model_name='county',
            name='province',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='county', to='iranian_cities.province', verbose_name='Province'),
        ),
        migrations.AddField(
            model_name='city',
            name='county',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='iranian_cities.county', verbose_name='County'),
        ),
        migrations.AddField(
            model_name='city',
            name='district',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='iranian_cities.district', verbose_name='District'),
        ),
        migrations.AddField(
            model_name='city',
            name='province',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='iranian_cities.province', verbose_name='province'),
        ),
    ]
