# Generated by Django 3.0.5 on 2021-03-31 15:30

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Pedido',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
            ],
        ),
        migrations.CreateModel(
            name='Pedidos',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('num_pedidos', models.PositiveIntegerField(default=0, unique=True)),
                ('total_price', models.DecimalField(decimal_places=2, max_digits=5)),
                ('entregado', models.BooleanField(default=False)),
                ('estado', models.CharField(choices=[('preparado', 'Preparado'), ('entregado', 'Entregado'), ('en concina', 'Cocinando'), ('recibida la solicitud de pedido', 'Recibido')], default='recibida la solicitud de pedido', max_length=45)),
                ('pagado', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=45)),
                ('price', models.DecimalField(decimal_places=2, max_digits=5)),
                ('description', models.TextField()),
                ('imagen', models.ImageField(blank=True, null=True, upload_to='imagenes/product')),
            ],
        ),
        migrations.CreateModel(
            name='Restaurant',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('email', models.EmailField(max_length=45, unique=True)),
                ('city', models.CharField(default='', max_length=50)),
                ('postalcode', models.CharField(default='', max_length=5)),
                ('adress', models.CharField(max_length=50, unique=True)),
                ('phone', models.IntegerField(default=0)),
                ('description', models.TextField(blank=True)),
                ('imagen', models.ImageField(blank=True, null=True, upload_to='imagenes/')),
            ],
        ),
        migrations.CreateModel(
            name='Rider',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('type_vehicle', models.CharField(default='', max_length=45)),
                ('libre', models.BooleanField(default=False)),
            ],
        ),
        migrations.DeleteModel(
            name='Image',
        ),
        migrations.RemoveField(
            model_name='user',
            name='user',
        ),
        migrations.AddField(
            model_name='user',
            name='birthday',
            field=models.DateField(null=True),
        ),
        migrations.AddField(
            model_name='user',
            name='city',
            field=models.CharField(default='', max_length=50),
        ),
        migrations.AddField(
            model_name='user',
            name='image',
            field=models.ImageField(blank=True, null=True, upload_to='imagenes'),
        ),
        migrations.AddField(
            model_name='user',
            name='name',
            field=models.CharField(default='', max_length=20),
        ),
        migrations.AddField(
            model_name='user',
            name='phone',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='user',
            name='postalcode',
            field=models.PositiveIntegerField(default=0),
        ),
        migrations.AlterField(
            model_name='user',
            name='id',
            field=models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False),
        ),
        migrations.AddField(
            model_name='product',
            name='id_restaurant',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='products', to='api.Restaurant'),
        ),
        migrations.AddField(
            model_name='pedidos',
            name='restaurants',
            field=models.ManyToManyField(related_name='pedidosrestaurant', to='api.Restaurant'),
        ),
        migrations.AddField(
            model_name='pedidos',
            name='rider',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pedidosrider', to='api.Rider'),
        ),
        migrations.AddField(
            model_name='pedido',
            name='pedidos',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pedidos', to='api.Pedidos'),
        ),
        migrations.AddField(
            model_name='user',
            name='pedido',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pedidouser', to='api.Pedido'),
        ),
        migrations.AddField(
            model_name='user',
            name='rider',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Rider'),
        ),
    ]
