# Generated by Django 2.2.3 on 2021-01-01 18:13

from decimal import Decimal
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django_countries.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('street_address', models.CharField(max_length=100)),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('city_name', models.CharField(max_length=100)),
                ('country', django_countries.fields.CountryField(max_length=2)),
                ('phone', models.CharField(blank=True, max_length=15, null=True)),
                ('zip', models.CharField(max_length=100)),
                ('updated_date', models.DateTimeField(auto_now_add=True, null=True)),
                ('create_date', models.DateTimeField(auto_now=True, null=True)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='address', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Addresses',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('item', models.CharField(max_length=255)),
                ('image', models.ImageField(blank=True, null=True, upload_to='product/images/uploads_date/%Y/%m/%d/')),
                ('price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
                ('stock_count', models.PositiveIntegerField()),
                ('category', models.CharField(max_length=100)),
                ('description', models.TextField(default='Product description.')),
                ('purchase_date', models.DateField(blank=True, null=True)),
                ('expire_date', models.DateField(blank=True, null=True)),
                ('uploaded_date', models.DateField(auto_now_add=True, null=True)),
                ('current_update', models.DateField(auto_now=True, null=True)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='ShippingAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('street_address', models.CharField(blank=True, max_length=100, null=True)),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('city_name', models.CharField(blank=True, max_length=100, null=True)),
                ('state_name', models.CharField(blank=True, max_length=100, null=True)),
                ('country', models.CharField(blank=True, default='Nigeria', max_length=100, null=True)),
                ('zip', models.CharField(max_length=100)),
                ('note', models.TextField(blank=True, default='shipping note', null=True)),
                ('updated_date', models.DateTimeField(auto_now_add=True)),
                ('create_date', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shipping', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Shipping Address',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('products', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)),
                ('quantities', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)),
                ('ordered', models.BooleanField(default=False)),
                ('total_price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('delivery_method', models.CharField(default='', max_length=30)),
                ('payment_method', models.CharField(default='', max_length=30)),
                ('ordered_date', models.DateTimeField(auto_now_add=True)),
                ('being_delivered', models.BooleanField(default=False)),
                ('received', models.BooleanField(default=False)),
                ('billing_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='billing_address', to='Products.Address')),
                ('shipping_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='shipping_address', to='Products.Address')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Orders',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
    ]

# Generated by Django 2.2.3 on 2021-01-01 18:13

from decimal import Decimal
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import django_countries.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('street_address', models.CharField(max_length=100)),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('city_name', models.CharField(max_length=100)),
                ('country', django_countries.fields.CountryField(max_length=2)),
                ('phone', models.CharField(blank=True, max_length=15, null=True)),
                ('zip', models.CharField(max_length=100)),
                ('updated_date', models.DateTimeField(auto_now_add=True, null=True)),
                ('create_date', models.DateTimeField(auto_now=True, null=True)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='address', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Addresses',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('item', models.CharField(max_length=255)),
                ('image', models.ImageField(blank=True, null=True, upload_to='product/images/uploads_date/%Y/%m/%d/')),
                ('price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=12)),
                ('stock_count', models.PositiveIntegerField()),
                ('category', models.CharField(max_length=100)),
                ('description', models.TextField(default='Product description.')),
                ('purchase_date', models.DateField(blank=True, null=True)),
                ('expire_date', models.DateField(blank=True, null=True)),
                ('uploaded_date', models.DateField(auto_now_add=True, null=True)),
                ('current_update', models.DateField(auto_now=True, null=True)),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='ShippingAddress',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('street_address', models.CharField(blank=True, max_length=100, null=True)),
                ('first_name', models.CharField(blank=True, max_length=100, null=True)),
                ('last_name', models.CharField(blank=True, max_length=100, null=True)),
                ('city_name', models.CharField(blank=True, max_length=100, null=True)),
                ('state_name', models.CharField(blank=True, max_length=100, null=True)),
                ('country', models.CharField(blank=True, default='Nigeria', max_length=100, null=True)),
                ('zip', models.CharField(max_length=100)),
                ('note', models.TextField(blank=True, default='shipping note', null=True)),
                ('updated_date', models.DateTimeField(auto_now_add=True)),
                ('create_date', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='shipping', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Shipping Address',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('deleted', models.DateTimeField(editable=False, null=True)),
                ('products', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)),
                ('quantities', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), default=list, size=None)),
                ('ordered', models.BooleanField(default=False)),
                ('total_price', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('delivery_method', models.CharField(default='', max_length=30)),
                ('payment_method', models.CharField(default='', max_length=30)),
                ('ordered_date', models.DateTimeField(auto_now_add=True)),
                ('being_delivered', models.BooleanField(default=False)),
                ('received', models.BooleanField(default=False)),
                ('billing_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='billing_address', to='Products.Address')),
                ('shipping_address', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='shipping_address', to='Products.Address')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Orders',
            },
            managers=[
                ('original_objects', django.db.models.manager.Manager()),
            ],
        ),
    ]

# Generated by Django 2.2.3 on 2021-01-01 18:13