CourseOverviews may be deleted, but we don't want to delete related objects

This commit is contained in:
Calen Pennington
2020-01-15 13:34:31 -05:00
parent 2abfc665da
commit 675b8c0d71
4 changed files with 44 additions and 2 deletions

View File

@@ -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'),
),
]

View File

@@ -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

View File

@@ -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'),
),
]

View File

@@ -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()