# Generated by Django 2.1.7 on 2019-05-12 17:25

from django.db import migrations, models
import django.db.models.deletion
import minke.contrib.commands.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Command',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cmd', models.TextField()),
                ('label', models.CharField(max_length=256)),
                ('description', models.TextField(blank=True)),
                ('active', models.BooleanField(default=True)),
                ('minketypes', models.ManyToManyField(limit_choices_to=minke.contrib.commands.models.get_minketypes, to='contenttypes.ContentType')),
            ],
        ),
        migrations.CreateModel(
            name='CommandGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('label', models.CharField(max_length=256)),
                ('description', models.TextField(blank=True)),
                ('as_options', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='CommandOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.SmallIntegerField()),
                ('command', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='commands.Command')),
                ('commands', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='commands.CommandGroup')),
            ],
            options={
                'get_latest_by': 'order',
            },
        ),
        migrations.AddField(
            model_name='commandgroup',
            name='commands',
            field=models.ManyToManyField(through='commands.CommandOrder', to='commands.Command'),
        ),
        migrations.AddField(
            model_name='commandgroup',
            name='minketypes',
            field=models.ManyToManyField(limit_choices_to=minke.contrib.commands.models.get_minketypes, to='contenttypes.ContentType'),
        ),
        migrations.AlterUniqueTogether(
            name='commandorder',
            unique_together={('commands', 'order')},
        ),
    ]
