# Generated by Django 3.0.8 on 2020-09-07 14:37

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cart_total', models.IntegerField(default=0)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='cart', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='cart_quantity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField()),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Capstone.Cart')),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total_cost', models.IntegerField(default=0)),
                ('shipping_address', models.CharField(max_length=1000)),
                ('contact', models.IntegerField()),
                ('date', models.DateField(auto_now_add=True)),
                ('status', models.BooleanField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ordered_quantity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('img_link', models.CharField(max_length=500)),
                ('rating', models.IntegerField()),
                ('price', models.CharField(max_length=100)),
                ('url', models.CharField(max_length=500)),
                ('shipping_price', models.CharField(max_length=100)),
                ('total_cost', models.IntegerField()),
                ('category', models.CharField(max_length=50)),
                ('cart', models.ManyToManyField(blank=True, related_name='cart_items', through='Capstone.cart_quantity', to='Capstone.Cart')),
                ('order', models.ManyToManyField(blank=True, related_name='ordered_items', through='Capstone.ordered_quantity', to='Capstone.Order')),
            ],
        ),
        migrations.AddField(
            model_name='ordered_quantity',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Capstone.Product'),
        ),
        migrations.AddField(
            model_name='ordered_quantity',
            name='order',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='Capstone.Order'),
        ),
        migrations.AddField(
            model_name='cart_quantity',
            name='item',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='Capstone.Product'),
        ),
    ]
