# Generated by Django 2.2.4 on 2019-08-27 11:22

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import easy_thumbnails.fields
import utils.methods


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('location', '0007_auto_20190826_1342'),
    ]

    operations = [
        migrations.CreateModel(
            name='EstablishmentType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='Name')),
                ('use_subtypes', models.BooleanField(default=True, verbose_name='Use subtypes')),
            ],
            options={
                'verbose_name': 'Establishment type',
                'verbose_name_plural': 'Establishment types',
            },
        ),
        migrations.CreateModel(
            name='EstablishmentSubType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='Name')),
                ('establishment_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='establishment.EstablishmentType', verbose_name='Type')),
            ],
            options={
                'verbose_name': 'Establishment subtype',
                'verbose_name_plural': 'Establishment subtypes',
            },
        ),
        migrations.CreateModel(
            name='Establishment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(default=django.utils.timezone.now, editable=False, verbose_name='Date created')),
                ('modified', models.DateTimeField(auto_now=True, verbose_name='Date updated')),
                ('image', easy_thumbnails.fields.ThumbnailerImageField(blank=True, default=None, null=True, upload_to=utils.methods.image_path, verbose_name='Image')),
                ('name', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=None, help_text='{"en":"some text"}', null=True, verbose_name='Name')),
                ('description', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=None, help_text='{"en":"some text"}', null=True, verbose_name='Description')),
                ('public_mark', models.PositiveIntegerField(blank=True, default=None, null=True, verbose_name='Public mark')),
                ('toque_number', models.PositiveIntegerField(blank=True, default=None, null=True, verbose_name='Toque number')),
                ('price_level', models.PositiveIntegerField(blank=True, default=None, null=True, verbose_name='Price level')),
                ('address', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, to='location.Address', verbose_name='Address')),
                ('establishment_subtypes', models.ManyToManyField(related_name='subtype_establishment', to='establishment.EstablishmentSubType', verbose_name='Subtype')),
                ('establishment_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='establishment', to='establishment.EstablishmentType', verbose_name='Type')),
            ],
            options={
                'verbose_name': 'Establishment',
                'verbose_name_plural': 'Establishments',
            },
        ),
    ]
