# Generated by Django 2.0.5 on 2018-06-19 03:18

from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0009_alter_user_last_name_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Dish',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=60)),
                ('image', models.ImageField(default='img/None/no-img.gif', upload_to='img/')),
                ('description', models.TextField(max_length=140)),
                ('price', models.FloatField()),
                ('cuisine_type', models.CharField(max_length=15)),
                ('dietary', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=10), null=True, size=None)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Kitchen',
            fields=[
                ('owner', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL)),
                ('name', models.CharField(blank=True, max_length=60)),
                ('logo', models.ImageField(default='img/None/no-img.gif', upload_to='img/')),
                ('description', models.TextField(max_length=140)),
                ('address', models.TextField()),
                ('rating', models.IntegerField(blank=True, null=True)),
                ('does_deliver', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order_time', models.DateTimeField(auto_now_add=True)),
                ('order_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_by', to=settings.AUTH_USER_MODEL)),
                ('order_from', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='order_from', to='homecooked.Kitchen')),
                ('order_item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dishes', to='homecooked.Dish')),
            ],
            options={
                'ordering': ['-order_by'],
            },
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=255)),
                ('avatar', models.ImageField(default='img/None/no-img.gif', upload_to='img/')),
                ('bio', models.TextField()),
                ('iscook', models.BooleanField(default=False)),
                ('address', models.TextField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='userprofile', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='dish',
            name='kitchen',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='dish', to='homecooked.Kitchen'),
        ),
    ]
