# Generated by Django 2.2 on 2021-03-05 10:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
            ],
        ),
        migrations.CreateModel(
            name='AttributeName',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('nazev', models.CharField(max_length=100)),
                ('kod', models.CharField(blank=True, max_length=100)),
                ('zobrazit', models.BooleanField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='AttributeValue',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('hodnota', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('obrazek', models.URLField()),
                ('nazev', models.CharField(blank=True, max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('nazev', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('cena', models.CharField(max_length=50)),
                ('mena', models.CharField(blank=True, max_length=3, null=True)),
                ('published_on', models.DateTimeField(blank=True, null=True)),
                ('is_published', models.BooleanField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='ProductImage',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('nazev', models.CharField(max_length=70)),
                ('obrazek_id', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='core.Image')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='core.Product')),
            ],
        ),
        migrations.CreateModel(
            name='ProductAttributes',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('attribute', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='core.Attribute')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='core.Product')),
            ],
        ),
        migrations.CreateModel(
            name='Catalog',
            fields=[
                ('id', models.PositiveIntegerField(db_index=True, primary_key=True, serialize=False, unique=True, verbose_name='Id')),
                ('nazev', models.CharField(blank=True, max_length=70, null=True)),
                ('attributes_ids', models.ManyToManyField(to='core.Attribute')),
                ('obrazek_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='core.Image')),
                ('products_ids', models.ManyToManyField(to='core.Product')),
            ],
        ),
        migrations.AddField(
            model_name='attribute',
            name='hodnota_atributu_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='attrstovalue', to='core.AttributeName'),
        ),
        migrations.AddField(
            model_name='attribute',
            name='nazev_atributu_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='attrstoname', to='core.AttributeName'),
        ),
    ]
