# Generated by Django 3.0.3 on 2020-06-09 13:38

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('core', '0005_auto_20200609_1227'),
    ]

    operations = [
        migrations.CreateModel(
            name='DiscountCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('code', models.CharField(max_length=32, unique=True)),
                ('reduction', models.DecimalField(decimal_places=2, max_digits=6)),
                ('active', models.BooleanField(default=True)),
                ('expiry', models.DateTimeField(blank=True, null=True)),
                ('max_usages', models.IntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Store')),
            ],
            options={
                'ordering': ['code'],
                'unique_together': {('store', 'code', 'active')},
            },
        ),
    ]
