django2.2: add on_delete on migrations for OneToOneField

This commit is contained in:
2019-10-06 00:38:25 +02:00
parent 3cb306bc91
commit f7548ab8d1
11 changed files with 37 additions and 6 deletions

View File

@ -36,6 +36,7 @@ class Migration(migrations.Migration):
model_name="club",
name="home",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
blank=True,
null=True,
related_name="home_of_club",

View File

@ -5,6 +5,7 @@ from django.db import migrations, models
from club.models import Club
from core.operations import PsqlRunOnly
import django.db.models.deletion
def generate_club_pages(apps, schema_editor):
@ -31,7 +32,11 @@ class Migration(migrations.Migration):
model_name="club",
name="page",
field=models.OneToOneField(
related_name="club", blank=True, null=True, to="core.Page"
on_delete=django.db.models.deletion.CASCADE,
related_name="club",
blank=True,
null=True,
to="core.Page",
),
),
migrations.AddField(