# Generated by Django 2.2.3 on 2019-07-06 06:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('client_phone', models.IntegerField(max_length=10, unique=True)),
                ('branch', models.CharField(max_length=100)),
                ('contact_person_name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Items',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('price', models.IntegerField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('otp', models.IntegerField(max_length=6)),
                ('delivery_status', models.IntegerField(max_length=1)),
                ('date', models.DateField()),
                ('time', models.TimeField()),
                ('user_phone', models.IntegerField()),
                ('delivery_date', models.DateField()),
                ('delivery_time', models.TextField()),
                ('total_price', models.IntegerField(max_length=10)),
                ('client_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Client')),
            ],
        ),
        migrations.CreateModel(
            name='OrderTemplate',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('quantity', models.IntegerField(max_length=10)),
                ('client_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Client')),
                ('item_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Items')),
            ],
        ),
        migrations.CreateModel(
            name='Shops',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('branch', models.CharField(max_length=100)),
                ('address', models.CharField(max_length=300)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('role', models.IntegerField(max_length=1)),
                ('phone', models.IntegerField(max_length=10, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_phone', models.IntegerField()),
                ('morning_time', models.TextField()),
                ('evening_time', models.TimeField()),
                ('date', models.DateField()),
                ('client_id', models.ForeignKey(on_delete=True, to='order_manager.Client')),
                ('order_template_id', models.ForeignKey(on_delete=True, to='order_manager.OrderTemplate')),
                ('user_id', models.ForeignKey(on_delete=True, to='order_manager.User')),
            ],
        ),
        migrations.CreateModel(
            name='OrderList',
            fields=[
                ('order_list_id', models.AutoField(primary_key=True, serialize=False)),
                ('price', models.IntegerField()),
                ('item_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Items')),
                ('order_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Order')),
                ('quantity', models.ForeignKey(on_delete=True, to='order_manager.OrderTemplate')),
            ],
        ),
        migrations.AddField(
            model_name='order',
            name='user_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.User'),
        ),
        migrations.AddField(
            model_name='items',
            name='shop_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Shops'),
        ),
        migrations.AddField(
            model_name='client',
            name='shop_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='order_manager.Shops'),
        ),
    ]
