text: # -*- coding: utf-8 -*-
  # Generated by Django 1.10.5 on 2017-04-15 15:04
  from __future__ import unicode_literals
  
  from django.conf import settings
  from django.db import migrations, models
  import django.db.models.deletion
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('cart', '0002_auto_20170414_1132'),
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
          ('products', '0002_auto_20170414_1124'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Address',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('address_type', models.CharField(choices=[('shipping', 'Shipping'), ('billing', 'Billing')], max_length=120)),
                  ('street', models.CharField(max_length=255)),
                  ('city', models.CharField(max_length=255)),
                  ('postcode', models.CharField(max_length=25)),
                  ('country', models.CharField(max_length=255)),
                  ('use_as_billing', models.BooleanField(default=True, verbose_name='Use shipping address as billing address')),
              ],
              options={
                  'verbose_name_plural': 'Addresses',
              },
          ),
          migrations.CreateModel(
              name='Delivery',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=125)),
                  ('price', models.PositiveIntegerField(default=0)),
                  ('delivery_time', models.TextField(max_length=255)),
              ],
              options={
                  'verbose_name': 'Delivery Method',
              },
          ),
          migrations.CreateModel(
              name='Order',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('full_name', models.CharField(max_length=120)),
                  ('email', models.EmailField(max_length=254)),
                  ('phone', models.CharField(blank=True, max_length=120, null=True)),
                  ('status', models.CharField(choices=[('created', 'Created'), ('in_progress', 'In Progress'), ('paid', 'Paid'), ('shipped', 'Shipped'), ('canceled', 'Cancelled')], default='created', max_length=120)),
                  ('created_at', models.DateTimeField(auto_now=True)),
                  ('updated_at', models.DateTimeField(auto_now_add=True)),
                  ('billing_address', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='billing_address', to='checkout.Address')),
                  ('cart', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='cart.Cart')),
                  ('delivery_method', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='delivery_method', to='checkout.Delivery')),
              ],
              options={
                  'ordering': ['-created_at'],
              },
          ),
          migrations.CreateModel(
              name='OrderItem',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                  ('quantity', models.PositiveIntegerField(default=1)),
                  ('total_price', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                  ('order', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='items', to='checkout.Order')),
                  ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='order_items', to='products.Product')),
              ],
          ),
          migrations.CreateModel(
              name='Payment',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=125)),
              ],
          ),
          migrations.AddField(
              model_name='order',
              name='payment_method',
              field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='payment_method', to='checkout.Payment'),
          ),
          migrations.AddField(
              model_name='order',
              name='shipping_address',
              field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='shipping_address', to='checkout.Address'),
          ),
          migrations.AddField(
              model_name='order',
              name='user',
              field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
          ),
      ]
  