# Generated by Django 3.0.2 on 2020-01-06 21:56

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name')),
                ('level', models.IntegerField(choices=[(1, 'voivodeship'), (2, 'county'), (3, 'community')], db_index=True)),
            ],
            options={
                'verbose_name': 'Category',
                'verbose_name_plural': 'Categories',
            },
        ),
        migrations.CreateModel(
            name='JednostkaAdministracyjna',
            fields=[
                ('id', models.CharField(max_length=7, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=36, verbose_name='Name')),
                ('slug', autoslug.fields.AutoSlugField(editable=False, populate_from='name', unique=True)),
                ('updated_on', models.DateField(verbose_name='Updated date')),
                ('active', models.BooleanField(default=False)),
                ('lft', models.PositiveIntegerField(editable=False)),
                ('rght', models.PositiveIntegerField(editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(editable=False)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teryt_tree.Category')),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='teryt_tree.JednostkaAdministracyjna')),
            ],
            options={
                'verbose_name': 'Unit of administrative division',
                'verbose_name_plural': 'Units of administrative division',
            },
        ),
        migrations.CreateModel(
            name='SIMC',
            fields=[
                ('id', models.CharField(max_length=7, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('updated_on', models.DateField(verbose_name='Updated date')),
                ('sym_pod', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, to='teryt_tree.SIMC')),
                ('terc', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='teryt_tree.JednostkaAdministracyjna')),
            ],
        ),
    ]
