# Generated by Django 2.2.1 on 2019-12-19 23:33

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


class Migration(migrations.Migration):

    dependencies = [
        ('companyinfo2', '0003_tier'),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('address_id', models.AutoField(primary_key=True, serialize=False)),
                ('address_name', models.CharField(max_length=45, unique=True)),
                ('address_number', models.IntegerField()),
                ('street_name', models.CharField(max_length=45)),
                ('district_name', models.CharField(max_length=45)),
                ('city_name', models.CharField(max_length=45)),
            ],
            options={
                'ordering': ['country', 'state', 'city_name', 'address_name'],
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('country_id', models.AutoField(primary_key=True, serialize=False)),
                ('country_name', models.CharField(max_length=45, unique=True)),
                ('country_code', models.CharField(max_length=5, unique=True)),
            ],
            options={
                'ordering': ['country_code', 'country_name'],
            },
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('state_id', models.AutoField(primary_key=True, serialize=False)),
                ('state_name', models.CharField(max_length=45, unique=True)),
                ('state_code', models.CharField(max_length=5, unique=True)),
            ],
            options={
                'ordering': ['state_code', 'state_name'],
            },
        ),
        migrations.CreateModel(
            name='Billing',
            fields=[
                ('billing_id', models.AutoField(primary_key=True, serialize=False)),
                ('billing_number', models.IntegerField(unique=True)),
                ('billing_name', models.CharField(max_length=45, unique=True)),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='billings', to='companyinfo2.Address')),
                ('supplier', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='billings', to='companyinfo2.Supplier')),
            ],
            options={
                'ordering': ['supplier__supplier_id', 'billing_number'],
            },
        ),
        migrations.AddField(
            model_name='address',
            name='country',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='addresses', to='companyinfo2.Country'),
        ),
        migrations.AddField(
            model_name='address',
            name='state',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='addresses', to='companyinfo2.State'),
        ),
    ]
