# Generated by Django 3.0.3 on 2020-07-04 12:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0016_passwordresetkey'),
        ('customers', '0004_auto_20200626_1336'),
        ('discounts', '0004_auto_20200612_1341'),
    ]

    operations = [
        migrations.CreateModel(
            name='DiscountCodeUsage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('discount_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='discounts.DiscountCode')),
                ('sale', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='customers.Sale')),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Store')),
                ('subscription', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='customers.MembershipSubscription')),
            ],
            options={
                'ordering': ['-created_at'],
                'unique_together': {('discount_code', 'subscription'), ('discount_code', 'sale')},
            },
        ),
    ]
