# Generated by Django 3.1.2 on 2020-10-23 06:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'db_table': 'categories',
            },
        ),
        migrations.CreateModel(
            name='DeliveryType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
            options={
                'db_table': 'delivery_types',
            },
        ),
        migrations.CreateModel(
            name='Description',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.CharField(max_length=512)),
                ('title', models.CharField(max_length=256)),
                ('content', models.CharField(max_length=1024)),
            ],
            options={
                'db_table': 'descriptions',
            },
        ),
        migrations.CreateModel(
            name='Discount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('percentage', models.PositiveIntegerField()),
                ('image', models.CharField(max_length=512)),
            ],
            options={
                'db_table': 'discounts',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('sub_title', models.CharField(max_length=128, null=True)),
                ('price', models.PositiveIntegerField()),
                ('image', models.CharField(max_length=512)),
                ('unit', models.CharField(max_length=64)),
                ('weight', models.CharField(max_length=64)),
                ('shipping_type', models.CharField(max_length=128)),
                ('origin', models.CharField(max_length=128, null=True)),
                ('allergen', models.CharField(max_length=512, null=True)),
                ('expiration_date', models.CharField(max_length=128, null=True)),
                ('information', models.CharField(max_length=512, null=True)),
                ('product_image', models.CharField(max_length=512)),
                ('is_recommended', models.BooleanField(default=False)),
                ('is_new', models.BooleanField(default=False)),
                ('check_point', models.CharField(max_length=512)),
            ],
            options={
                'db_table': 'products',
            },
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='SubCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.category')),
            ],
            options={
                'db_table': 'sub_categories',
            },
        ),
        migrations.CreateModel(
            name='ProductTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
                ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.tag')),
            ],
        ),
        migrations.CreateModel(
            name='ProductSeries',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('price', models.PositiveIntegerField()),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'db_table': 'product_series',
            },
        ),
        migrations.CreateModel(
            name='ProductDeliveryType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('delivery_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.deliverytype')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.product')),
            ],
            options={
                'db_table': 'product_delivery_types',
            },
        ),
        migrations.AddField(
            model_name='product',
            name='delivery_type',
            field=models.ManyToManyField(related_name='product_with_delivery_type', through='products.ProductDeliveryType', to='products.DeliveryType'),
        ),
        migrations.AddField(
            model_name='product',
            name='description',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.description'),
        ),
        migrations.AddField(
            model_name='product',
            name='discount',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='products.discount'),
        ),
        migrations.AddField(
            model_name='product',
            name='sub_category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='products.subcategory'),
        ),
        migrations.AddField(
            model_name='product',
            name='tag',
            field=models.ManyToManyField(related_name='product_with_tag', through='products.ProductTag', to='products.Tag'),
        ),
    ]
