|
| 1 | +# Generated by Django 4.2.20 on 2025-04-14 12:39 |
| 2 | + |
| 3 | +from django.conf import settings |
| 4 | +from django.db import migrations, models |
| 5 | +import django.db.models.deletion |
| 6 | +import opaque_keys.edx.django.models |
| 7 | + |
| 8 | + |
| 9 | +class Migration(migrations.Migration): |
| 10 | + |
| 11 | + initial = True |
| 12 | + |
| 13 | + dependencies = [ |
| 14 | + migrations.swappable_dependency(settings.AUTH_USER_MODEL), |
| 15 | + ] |
| 16 | + |
| 17 | + operations = [ |
| 18 | + migrations.CreateModel( |
| 19 | + name='CourseArchiveStatus', |
| 20 | + fields=[ |
| 21 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 22 | + ('course_id', opaque_keys.edx.django.models.CourseKeyField(db_index=True, help_text='The unique identifier for the course.', max_length=255)), |
| 23 | + ('is_archived', models.BooleanField(db_index=True, default=False, help_text='Whether the course is archived.')), |
| 24 | + ('archive_date', models.DateTimeField(blank=True, help_text='The date and time when the course was archived.', null=True)), |
| 25 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 26 | + ('updated_at', models.DateTimeField(auto_now=True)), |
| 27 | + ('user', models.ForeignKey(help_text='The user who this archive status is for.', on_delete=django.db.models.deletion.CASCADE, related_name='course_archive_statuses', to=settings.AUTH_USER_MODEL)), |
| 28 | + ], |
| 29 | + options={ |
| 30 | + 'verbose_name': 'Course Archive Status', |
| 31 | + 'verbose_name_plural': 'Course Archive Statuses', |
| 32 | + 'ordering': ['-updated_at'], |
| 33 | + }, |
| 34 | + ), |
| 35 | + migrations.AddConstraint( |
| 36 | + model_name='coursearchivestatus', |
| 37 | + constraint=models.UniqueConstraint(fields=('course_id', 'user'), name='unique_user_course_archive_status'), |
| 38 | + ), |
| 39 | + ] |
0 commit comments