# Generated by Django 2.2.4 on 2019-08-21 04:26

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id_country', models.AutoField(primary_key=True, serialize=False)),
                ('country', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'country',
                'verbose_name_plural': 'countries',
                'db_table': 'countries',
            },
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id_district', models.AutoField(primary_key=True, serialize=False)),
                ('district', models.CharField(max_length=100)),
            ],
            options={
                'verbose_name': 'district',
                'verbose_name_plural': 'districts',
                'db_table': 'districts',
            },
        ),
        migrations.CreateModel(
            name='Subdisctrict',
            fields=[
                ('id_subdistrict', models.AutoField(primary_key=True, serialize=False)),
                ('subdisctrict', models.CharField(max_length=100)),
                ('id_district', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subdisctricts', to='areas.District')),
            ],
            options={
                'verbose_name': 'subdisctrict',
                'verbose_name_plural': 'subdisctricts',
                'db_table': 'subdisctricts',
            },
        ),
        migrations.CreateModel(
            name='Village',
            fields=[
                ('id_village', models.AutoField(primary_key=True, serialize=False)),
                ('village', models.CharField(max_length=100)),
                ('id_subdistrict', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='villages', to='areas.Subdisctrict')),
            ],
            options={
                'verbose_name': 'village',
                'verbose_name_plural': 'villages',
                'db_table': 'villages',
            },
        ),
        migrations.CreateModel(
            name='Province',
            fields=[
                ('id_province', models.AutoField(primary_key=True, serialize=False)),
                ('province', models.CharField(max_length=100)),
                ('id_country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='provinces', to='areas.Country')),
            ],
            options={
                'verbose_name': 'province',
                'verbose_name_plural': 'provinces',
                'db_table': 'provinces',
            },
        ),
        migrations.CreateModel(
            name='PostalCode',
            fields=[
                ('postal_code', models.CharField(max_length=5, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('id_village', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='postalcodes', to='areas.Village')),
            ],
            options={
                'verbose_name': 'postal_code',
                'verbose_name_plural': 'postal_codes',
                'db_table': 'postal_code',
            },
        ),
        migrations.AddField(
            model_name='district',
            name='id_province',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='districts', to='areas.Province'),
        ),
    ]
