# Generated by Django 2.2.7 on 2019-11-17 11:17

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


class Migration(migrations.Migration):

    dependencies = [
        ('gallery', '0006_merge_20191027_1758'),
        ('establishment', '0061_auto_20191114_0550'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='establishmentnote',
            options={'verbose_name': 'establishment note', 'verbose_name_plural': 'establishment notes'},
        ),
        migrations.CreateModel(
            name='EstablishmentGallery',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_main', models.BooleanField(default=False, verbose_name='Is the main image')),
                ('establishment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='establishment_gallery', to='establishment.Establishment', verbose_name='establishment')),
                ('image', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='establishment_gallery', to='gallery.Image', verbose_name='image')),
            ],
            options={
                'verbose_name': 'establishment gallery',
                'verbose_name_plural': 'establishment galleries',
                'unique_together': {('establishment', 'is_main'), ('establishment', 'image')},
            },
        ),
        migrations.AddField(
            model_name='establishment',
            name='gallery',
            field=models.ManyToManyField(through='establishment.EstablishmentGallery', to='gallery.Image'),
        ),
    ]
