# Generated by Django 2.1.2 on 2018-10-02 17:26

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Element',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('icon', models.ImageField(upload_to='categories/elements')),
                ('name', models.CharField(max_length=64)),
                ('description', models.CharField(blank=True, max_length=512, null=True)),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('moderated', models.BooleanField(blank=True, default=None, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('icon', models.ImageField(upload_to='categories/groups')),
                ('name', models.CharField(max_length=64)),
                ('description', models.CharField(blank=True, max_length=512, null=True)),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='childs', to='categories.Group', verbose_name='Parent')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='element',
            name='group',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='elements', to='categories.Group'),
        ),
    ]
