# Generated by Django 2.1a1 on 2019-07-20 17:44

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='Bill',
            fields=[
                ('Bill_id', models.AutoField(max_length=50, primary_key=True, serialize=False)),
                ('Order_id', models.CharField(max_length=100, null=True)),
                ('invoice_url', models.CharField(max_length=1000)),
                ('datetime', models.DateTimeField(auto_now_add=True)),
                ('shipping_charges', models.IntegerField(default=50)),
                ('order_status', models.IntegerField(default=0)),
                ('delivered_datetime', models.DateTimeField(auto_now_add=True)),
                ('User_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('Customer_id', models.AutoField(max_length=50, primary_key=True, serialize=False)),
                ('phone_number', models.CharField(max_length=15)),
                ('address', models.CharField(max_length=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('Order_id', models.AutoField(max_length=50, primary_key=True, serialize=False)),
                ('heading', models.CharField(max_length=20, null=True)),
                ('quantity', models.IntegerField(blank=True, default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('Product_id', models.AutoField(max_length=50, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50)),
                ('image', models.FileField(upload_to='')),
                ('description', models.CharField(max_length=100)),
                ('quantity', models.IntegerField()),
                ('price', models.IntegerField()),
                ('category', models.CharField(max_length=100)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('review', models.CharField(max_length=1000)),
                ('rating', models.IntegerField()),
                ('Product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.Product')),
            ],
        ),
        migrations.CreateModel(
            name='UserDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('customer', models.OneToOneField(default=1, on_delete=django.db.models.deletion.CASCADE, to='web.Customer')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='Product_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='web.Product'),
        ),
        migrations.AddField(
            model_name='order',
            name='User_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
