# Generated by Django 2.2.4 on 2019-08-08 11:24

from django.conf import settings
import django.contrib.postgres.fields
import django.contrib.postgres.fields.jsonb
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session_id', models.UUIDField(default=uuid.uuid4, editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='Food',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('pricePerQuantity', models.IntegerField()),
                ('rating', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('orderCount', models.IntegerField(default=0)),
                ('description', models.CharField(max_length=5000)),
                ('imageUrl', models.URLField(blank=True, null=True)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='foods', to='resturant.Category')),
            ],
        ),
        migrations.CreateModel(
            name='RestaurantInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('service_tax', models.DecimalField(decimal_places=5, default=0, max_digits=10)),
                ('description', models.CharField(blank=True, max_length=1000, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Type',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type_name', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Table',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('table_status', models.CharField(choices=[('1', 'booked'), ('2', 'reserved'), ('3', 'free')], max_length=1)),
                ('User', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='current_table', to=settings.AUTH_USER_MODEL, verbose_name='linked_user')),
            ],
        ),
        migrations.CreateModel(
            name='Rate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.PositiveIntegerField(blank=True, null=True, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resturant.Customer')),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resturant.Food')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('designation', models.CharField(choices=[('1', 'manager'), ('2', 'waiter')], max_length=1)),
                ('contact_no', models.CharField(max_length=12)),
                ('address', models.CharField(max_length=50)),
                ('image', models.ImageField(default='default.jpg', upload_to='profile_pics')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), default=list, size=None)),
                ('dateOfCreation', models.DateTimeField(auto_now_add=True)),
                ('costList', django.contrib.postgres.fields.ArrayField(base_field=models.IntegerField(), blank=True, default=list, size=None)),
                ('totalCost', models.IntegerField(default=0)),
                ('order_status', models.CharField(choices=[('1', 'pending'), ('2', 'confirmed')], default='1', max_length=1)),
                ('eta', models.CharField(blank=True, default=0, max_length=3, null=True)),
                ('food', models.ManyToManyField(to='resturant.Food')),
                ('table', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='resturant.Table')),
            ],
        ),
        migrations.AddField(
            model_name='food',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='foods', to='resturant.Type'),
        ),
    ]
