# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-09-17 19:54
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    dependencies = [
        ('marketplace', '0036_api_secret_code'),
    ]

    operations = [
        migrations.CreateModel(
            name='ComponentUsage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('usage', models.PositiveIntegerField(default=0)),
                ('date', models.DateField()),
                ('component', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='marketplace.PlanComponent')),
                ('order_item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='usages', to='marketplace.OrderItem')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='componentusage',
            unique_together=set([('order_item', 'component', 'date')]),
        ),
    ]
