# Generated by Django 2.1.2 on 2019-02-21 11:21

import dj_address.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import oscar.models.fields
import phonenumber_field.modelfields


class Migration(migrations.Migration):

    replaces = [('address', '0001_initial'), ('address', '0002_auto_20150927_1547'), ('address', '0003_auto_20150927_1551'), ('address', '0004_auto_20170226_1122'), ('address', '0005_regenerate_user_address_hashes'), ('address', '0006_auto_20181115_1953'), ('address', '0007_auto_20190221_0223'), ('address', '0008_auto_20190221_0313'), ('address', '0009_auto_20190221_0347')]

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('dj_address', '0002_auto_20160213_1726'),
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('iso_3166_1_a2', models.CharField(max_length=2, primary_key=True, serialize=False, verbose_name='ISO 3166-1 alpha-2')),
                ('iso_3166_1_a3', models.CharField(blank=True, max_length=3, verbose_name='ISO 3166-1 alpha-3')),
                ('iso_3166_1_numeric', models.CharField(blank=True, max_length=3, verbose_name='ISO 3166-1 numeric')),
                ('printable_name', models.CharField(db_index=True, max_length=128, verbose_name='Country name')),
                ('name', models.CharField(max_length=128, verbose_name='Official name')),
                ('display_order', models.PositiveSmallIntegerField(db_index=True, default=0, help_text='Higher the number, higher the country in the list.', verbose_name='Display order')),
                ('is_shipping_country', models.BooleanField(db_index=True, default=False, verbose_name='Is shipping country')),
            ],
            options={
                'ordering': ('-display_order', 'printable_name'),
                'verbose_name_plural': 'Countries',
                'verbose_name': 'Country',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='UserAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, choices=[('Mr', 'Mr'), ('Miss', 'Miss'), ('Mrs', 'Mrs'), ('Ms', 'Ms'), ('Dr', 'Dr')], max_length=64, verbose_name='Title')),
                ('first_name', models.CharField(blank=True, max_length=255, verbose_name='First name')),
                ('last_name', models.CharField(blank=True, max_length=255, verbose_name='Last name')),
                ('address', dj_address.models.AddressField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='dj_address.Address')),
                ('unit_designator', models.CharField(blank=True, max_length=32, null=True)),
                ('phone_number', phonenumber_field.modelfields.PhoneNumberField(blank=True, help_text='In case we need to call you about your order', max_length=128, verbose_name='Phone number')),
                ('notes', models.TextField(blank=True, help_text='Tell us anything we should know when delivering your order.', verbose_name='Instructions')),
                ('is_default_for_shipping', models.BooleanField(default=False, verbose_name='Default shipping address?')),
                ('is_default_for_billing', models.BooleanField(default=False, verbose_name='Default billing address?')),
                ('num_orders_as_shipping_address', models.PositiveIntegerField(default=0, verbose_name='Number of Orders as Shipping Address')),
                ('date_created', models.DateTimeField(auto_now_add=True, verbose_name='Date Created')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='addresses', to=settings.AUTH_USER_MODEL, verbose_name='User')),
                ('num_orders_as_billing_address', models.PositiveIntegerField(default=0, verbose_name='Number of Orders as Billing Address')),
            ],
            options={
                'ordering': ['-num_orders'],
                'verbose_name_plural': 'User addresses',
                'verbose_name': 'User address',
                'abstract': False,
            },
        ),
        migrations.AlterModelOptions(
            name='useraddress',
            options={'ordering': ['-num_orders_as_shipping_address'], 'verbose_name': 'User address', 'verbose_name_plural': 'User addresses'},
        ),
        migrations.AlterField(
            model_name='useraddress',
            name='address',
            field=dj_address.models.AddressField(default=1, on_delete=django.db.models.deletion.PROTECT, to='dj_address.Address'),
            preserve_default=False,
        ),
    ]
