# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-10-21 12:52
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('store', '0043_auto_20161017_1730'),
    ]

    operations = [
        migrations.CreateModel(
            name='ChainStore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='\u8fde\u9501\u5e97')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='\u5e97\u4e3b')),
            ],
            options={
                'verbose_name': '\u8fde\u9501\u5e97',
                'verbose_name_plural': '\u8fde\u9501\u5e97',
            },
        ),
        migrations.CreateModel(
            name='StoreCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='\u5206\u7c7b\u540d')),
                ('level', models.PositiveIntegerField(verbose_name='\u5c42')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='\u751f\u6210\u65e5\u671f')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='store.StoreCategory', verbose_name='\u4e0a\u7ea7\u5206\u7c7b')),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='category', to='store.ChainStore', verbose_name='\u5546\u5e97')),
            ],
            options={
                'verbose_name': '\u5546\u5e97\u5546\u54c1\u5206\u7c7b',
                'verbose_name_plural': '\u5546\u5e97\u5546\u54c1\u5206\u7c7b',
            },
        ),
        migrations.AlterUniqueTogether(
            name='storecategory',
            unique_together=set([('store', 'name', 'level')]),
        ),
    ]
