# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-10-02 07:24
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('marketplace', '0038_drop_offerings'),
    ]

    operations = [
        migrations.CreateModel(
            name='OfferingComponent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', models.CharField(blank=True, max_length=500, verbose_name='description')),
                ('billing_type', models.CharField(choices=[('fixed', 'Fixed-price'), ('usage', 'Usage-based')], default='fixed', max_length=5)),
                ('type', models.CharField(help_text='Unique internal name of the measured unit, for example floating_ip.', max_length=50)),
                ('name', models.CharField(help_text='Display name for the measured unit, for example, Floating IP.', max_length=150)),
                ('measured_unit', models.CharField(help_text='Unit of measurement, for example, GB.', max_length=30, blank=True)),
                ('offering', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='components', to='marketplace.Offering')),
            ],
        ),
        migrations.AlterField(
            model_name='componentquota',
            name='component',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='marketplace.OfferingComponent'),
        ),
        migrations.AlterField(
            model_name='componentusage',
            name='component',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='marketplace.OfferingComponent'),
        ),
        migrations.AddField(
            model_name='plancomponent',
            name='component',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='components', to='marketplace.OfferingComponent'),
        ),
        migrations.AlterUniqueTogether(
            name='plancomponent',
            unique_together=set([('plan', 'component')]),
        ),
        migrations.RemoveField(
            model_name='plancomponent',
            name='billing_type',
        ),
        migrations.RemoveField(
            model_name='plancomponent',
            name='description',
        ),
        migrations.RemoveField(
            model_name='plancomponent',
            name='measured_unit',
        ),
        migrations.RemoveField(
            model_name='plancomponent',
            name='name',
        ),
        migrations.RemoveField(
            model_name='plancomponent',
            name='type',
        ),
        migrations.AlterUniqueTogether(
            name='offeringcomponent',
            unique_together=set([('type', 'offering')]),
        ),
    ]
