# Generated by Django 3.0.14 on 2022-07-21 10:28

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


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0007_serviceaccount'),
        ('courses', '0072_coursemodule_moe_id'),
    ]

    operations = [
        migrations.CreateModel(
            name='ServiceAccountCourse',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='service_accounts', to='courses.Course', verbose_name='курс')),
                ('service_account', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='courses', to='users.ServiceAccount', verbose_name='сервисный аккаунт')),
            ],
            options={
                'verbose_name': 'Курс сервисного аккаунта',
                'verbose_name_plural': 'Курсы сервисных аккаунтов',
            },
        ),
        migrations.AddConstraint(
            model_name='serviceaccountcourse',
            constraint=models.UniqueConstraint(fields=('service_account', 'course'), name='unique_service_account_per_course'),
        ),
    ]
