DENG-17 Make schedules and schedulehistory the same (#23419)

This commit is contained in:
Cory Lee
2020-03-17 14:40:04 -04:00
committed by GitHub
parent 5591a2358a
commit d0c3f16c2c
2 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.28 on 2020-03-16 19:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('schedules', '0018_readd_historicalschedule_fks'),
]
operations = [
migrations.AlterField(
model_name='schedule',
name='enrollment',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='student.CourseEnrollment'),
),
migrations.AlterField(
model_name='schedule',
name='start_date',
field=models.DateTimeField(db_index=True, default=None, help_text='Date this schedule went into effect', null=True),
),
migrations.AlterField(
model_name='scheduleexperience',
name='schedule',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='experience', to='schedules.Schedule'),
),
]

View File

@@ -14,7 +14,7 @@ class Schedule(TimeStampedModel):
.. no_pii:
"""
enrollment = models.OneToOneField('student.CourseEnrollment', null=False, on_delete=models.CASCADE, db_constraint=False)
enrollment = models.OneToOneField('student.CourseEnrollment', null=False, on_delete=models.CASCADE)
active = models.BooleanField(
default=True,
help_text=_('Indicates if this schedule is actively used')
@@ -70,5 +70,5 @@ class ScheduleExperience(models.Model):
(1, 'course_updates', u'Course Updates')
)
schedule = models.OneToOneField(Schedule, related_name='experience', on_delete=models.CASCADE, db_constraint=False)
schedule = models.OneToOneField(Schedule, related_name='experience', on_delete=models.CASCADE)
experience_type = models.PositiveSmallIntegerField(choices=EXPERIENCES, default=EXPERIENCES.default)