diff --git a/common/djangoapps/course_modes/migrations/0013_auto_20200115_2022.py b/common/djangoapps/course_modes/migrations/0013_auto_20200115_2022.py new file mode 100644 index 0000000000..bd33c71d01 --- /dev/null +++ b/common/djangoapps/course_modes/migrations/0013_auto_20200115_2022.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.27 on 2020-01-15 20:22 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('course_modes', '0012_historicalcoursemode'), + ] + + operations = [ + migrations.AlterField( + model_name='coursemode', + name='course', + field=models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name='modes', to='course_overviews.CourseOverview'), + ), + ] diff --git a/common/djangoapps/course_modes/models.py b/common/djangoapps/course_modes/models.py index 540145d711..e2aca1b2c5 100644 --- a/common/djangoapps/course_modes/models.py +++ b/common/djangoapps/course_modes/models.py @@ -54,7 +54,7 @@ class CourseMode(models.Model): db_constraint=False, db_index=True, related_name='modes', - on_delete=models.CASCADE, + on_delete=models.DO_NOTHING, ) # Django sets the `course_id` property in __init__ with the value from the database diff --git a/common/djangoapps/entitlements/migrations/0014_auto_20200115_2022.py b/common/djangoapps/entitlements/migrations/0014_auto_20200115_2022.py new file mode 100644 index 0000000000..f7fa755e30 --- /dev/null +++ b/common/djangoapps/entitlements/migrations/0014_auto_20200115_2022.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.27 on 2020-01-15 20:22 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('entitlements', '0013_historicalcourseentitlementsupportdetail'), + ] + + operations = [ + migrations.AlterField( + model_name='courseentitlementsupportdetail', + name='unenrolled_run', + field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='course_overviews.CourseOverview'), + ), + ] diff --git a/common/djangoapps/entitlements/models.py b/common/djangoapps/entitlements/models.py index 9efe7bb432..f018d3e0ba 100644 --- a/common/djangoapps/entitlements/models.py +++ b/common/djangoapps/entitlements/models.py @@ -499,7 +499,7 @@ class CourseEntitlementSupportDetail(TimeStampedModel): null=True, blank=True, db_constraint=False, - on_delete=models.CASCADE, + on_delete=models.DO_NOTHING, ) history = HistoricalRecords()