django2.2: add on_delete on migrations for ForeignKey

This commit is contained in:
2019-10-06 00:32:54 +02:00
parent c20d5855e4
commit 3cb306bc91
30 changed files with 233 additions and 36 deletions

View File

@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
@ -28,12 +29,16 @@ class Migration(migrations.Migration):
(
"picture",
models.ForeignKey(
related_name="people", to="sas.Picture", verbose_name="picture"
on_delete=django.db.models.deletion.CASCADE,
related_name="people",
to="sas.Picture",
verbose_name="picture",
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="pictures",
to=settings.AUTH_USER_MODEL,
verbose_name="user",