# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-09-23 16:46
from __future__ import unicode_literals

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


def create_designer(apps, schema_editor):
    Designer = apps.get_model('products', 'Designer')
    Designer.objects.create(name='designer')


def delete_designer(apps, schema_editor):
    Designer = apps.get_model('products', 'Designer')
    Designer.objects.filter(name='designer').delete()


class Migration(migrations.Migration):
    dependencies = [
        ('products', '0003_product_is_featured'),
    ]

    operations = [
        migrations.CreateModel(
            name='Designer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
            ],
        ),
        migrations.RunPython(create_designer, delete_designer),
        migrations.AddField(
            model_name='product',
            name='designer',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='products.Designer',
                                    verbose_name='Designer'),
            preserve_default=False,
        ),
    ]
