# Generated by Django 3.1.7 on 2021-09-29 19:31

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('taggit', '0003_taggeditem_add_unique_index'),
    ]

    operations = [
        migrations.CreateModel(
            name='Resource',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='ResourceGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
            ],
        ),
        migrations.CreateModel(
            name='ResourceGroupTextAttributeDefinition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('help_text', models.CharField(blank=True, default='', max_length=100, null=True)),
                ('resource_group_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='text_attribute_definitions', related_query_name='text_attribute_definition', to='resource_tracker.resourcegroup')),
            ],
        ),
        migrations.CreateModel(
            name='ResourcePool',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
            ],
        ),
        migrations.CreateModel(
            name='ResourceTextAttribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(default='', max_length=500)),
                ('resource', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='text_attributes', related_query_name='text_attribute', to='resource_tracker.resource')),
                ('text_attribute_type', models.ForeignKey(default='', on_delete=django.db.models.deletion.CASCADE, related_name='text_attribute_types', related_query_name='text_attribute_type', to='resource_tracker.resourcegrouptextattributedefinition')),
            ],
        ),
        migrations.CreateModel(
            name='ResourcePoolAttributeDefinition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('over_commitment_producers', models.FloatField(default=1)),
                ('over_commitment_consumers', models.FloatField(default=1)),
                ('resource_pool', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attribute_definitions', related_query_name='attribute_definition', to='resource_tracker.resourcepool')),
            ],
        ),
        migrations.CreateModel(
            name='ResourceGroupAttributeDefinition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('help_text', models.CharField(blank=True, default='', max_length=100, null=True)),
                ('consume_from', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='consumers', related_query_name='consumer', to='resource_tracker.resourcepoolattributedefinition')),
                ('produce_for', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='producers', related_query_name='producer', to='resource_tracker.resourcepoolattributedefinition')),
                ('resource_group_definition', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='attribute_definitions', related_query_name='attribute_definition', to='resource_tracker.resourcegroup')),
            ],
        ),
        migrations.CreateModel(
            name='ResourceAttribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.PositiveIntegerField(default=0)),
                ('attribute_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attribute_types', related_query_name='attribute_type', to='resource_tracker.resourcegroupattributedefinition')),
                ('resource', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attributes', related_query_name='attribute', to='resource_tracker.resource')),
            ],
        ),
        migrations.AddField(
            model_name='resource',
            name='resource_group',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='resources', related_query_name='resource', to='resource_tracker.resourcegroup'),
        ),
    ]
