# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-08-22 21:03
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
import mptt.fields


class Migration(migrations.Migration):

    dependencies = [
        ('bruv', '0014_auto_20160819_2008'),
    ]

    operations = [
        migrations.CreateModel(
            name='HabitatSubstrate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Substrate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('active', models.BooleanField(default=True, help_text='overridden if parent is inactive')),
                ('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', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='bruv.Substrate')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', django.db.models.manager.Manager()),
            ],
        ),
        migrations.AddField(
            model_name='habitatsubstrate',
            name='set',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bruv.Set'),
        ),
        migrations.AddField(
            model_name='habitatsubstrate',
            name='substrate',
            field=mptt.fields.TreeForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bruv.Substrate'),
        ),
        migrations.AddField(
            model_name='set',
            name='substrate',
            field=models.ManyToManyField(through='bruv.HabitatSubstrate', to='bruv.Substrate'),
        ),
    ]
