# Generated by Django 3.2.8 on 2021-12-25 22:09

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


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0014_alter_publicprofile_bio'),
        ('courses', '0017_delete_discount'),
    ]

    operations = [
        migrations.CreateModel(
            name='Discount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('discount', models.FloatField()),
                ('created_date', models.DateTimeField(auto_now_add=True)),
                ('expiration_date', models.DateTimeField()),
                ('title', models.CharField(max_length=255)),
                ('code', models.CharField(max_length=12, unique=True, validators=[django.core.validators.RegexValidator(regex='^[a-zA-Z0-9]*$')])),
                ('used_no', models.IntegerField(default=0)),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='discont_courses', to='courses.course')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='discount_codes', to='accounts.instructor')),
            ],
        ),
    ]
