# Generated by Django 2.1 on 2018-12-06 10:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('location', '0001_initial'),
        ('goods', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='GoodsInStore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('goods', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='goods.Goods', verbose_name='Товар')),
            ],
            options={
                'verbose_name': 'Торгова точка - Товар',
                'verbose_name_plural': 'Торгові точки - Товари',
            },
        ),
        migrations.CreateModel(
            name='Store',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=256, verbose_name='Назва')),
                ('address', models.CharField(max_length=256, verbose_name='Адреса')),
                ('lat', models.FloatField(blank=True, null=True, verbose_name='Широта')),
                ('lon', models.FloatField(blank=True, null=True, verbose_name='Довгота')),
                ('goods', models.ManyToManyField(through='store.GoodsInStore', to='goods.Goods')),
                ('region', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='store_region', to='location.Region', verbose_name='Район')),
            ],
            options={
                'verbose_name': 'Торгова точка',
                'verbose_name_plural': 'Торгові точки',
            },
        ),
        migrations.AddField(
            model_name='goodsinstore',
            name='store',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='store.Store', verbose_name='Торгова точка'),
        ),
    ]
