# Generated by Django 3.1.6 on 2021-03-05 17:43

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('contenttypes', '0002_remove_content_type_name'),
        ('mlmtools', '0008_auto_20210220_1744'),
    ]

    operations = [
        migrations.AlterField(
            model_name='trackcode',
            name='usage',
            field=models.CharField(choices=[('always', 'always'), ('useronce', '1x / user'), ('once', 'once only')], default='useronce', max_length=8),
        ),
        migrations.AlterField(
            model_name='trackcode',
            name='valid_from',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name='trackcode',
            name='valid_until',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.CreateModel(
            name='CodeUse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.PositiveIntegerField(null=True)),
                ('used_at', models.DateTimeField(auto_now=True, db_index=True)),
                ('amount', models.DecimalField(decimal_places=2, default=10, max_digits=5)),
                ('code', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='mlmtools.trackcode')),
                ('content_type', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='contenttypes.contenttype')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
