# Generated by Django 2.2.13 on 2020-06-17 12:05

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='Name')),
                ('line_1', models.CharField(max_length=128, verbose_name='Address Line 1')),
                ('line_2', models.CharField(blank=True, max_length=128, verbose_name='Address Line 2')),
                ('city', models.CharField(max_length=64, verbose_name='City')),
                ('postcode', models.CharField(max_length=10, verbose_name='Postcode')),
            ],
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('iso', models.CharField(max_length=2, primary_key=True, serialize=False)),
                ('name_official', models.CharField(max_length=128)),
                ('name', models.CharField(max_length=128)),
                ('sort_priority', models.PositiveIntegerField(default=0)),
            ],
            options={
                'verbose_name_plural': 'Countries',
                'ordering': ('-sort_priority', 'name'),
            },
        ),
        migrations.CreateModel(
            name='ShippingRateProcessor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('countries', models.ManyToManyField(to='shipping.Country')),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_shipping.shippingrateprocessor_set+', to='contenttypes.ContentType')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='ShippingRate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Unique name to refer to this shipping rate by', max_length=32, unique=True)),
                ('rate', models.DecimalField(decimal_places=2, max_digits=12, verbose_name='Shipping Rate')),
                ('carrier', models.CharField(max_length=64, verbose_name='Carrier')),
                ('description', models.CharField(max_length=128, verbose_name='Description')),
                ('basket_id', models.CharField(blank=True, db_index=True, max_length=32, verbose_name='Basket ID')),
                ('countries', models.ManyToManyField(to='shipping.Country', verbose_name='Shipping Country')),
                ('destination', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='shipping.Address', verbose_name='Destination')),
                ('processor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='shipping.ShippingRateProcessor')),
            ],
        ),
        migrations.AddField(
            model_name='address',
            name='country',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='shipping.Country', verbose_name='Country'),
        ),
    ]
