Verified Commit f7548ab8 authored by Sli's avatar Sli
Browse files

django2.2: add on_delete on migrations for OneToOneField

parent 3cb306bc
......@@ -40,6 +40,7 @@ class Migration(migrations.Migration):
model_name="operation",
name="linked_operation",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
blank=True,
to="accounting.Operation",
null=True,
......
......@@ -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",
......
......@@ -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(
......
......@@ -277,6 +277,7 @@ class Migration(migrations.Migration):
(
"group_ptr",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
parent_link=True,
serialize=False,
......@@ -431,7 +432,9 @@ class Migration(migrations.Migration):
(
"user",
models.OneToOneField(
to=settings.AUTH_USER_MODEL, related_name="preferences"
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
related_name="preferences",
),
),
],
......@@ -525,6 +528,7 @@ class Migration(migrations.Migration):
model_name="user",
name="home",
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
blank=True,
null=True,
related_name="home_of",
......
......@@ -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):
......@@ -35,7 +36,9 @@ class Migration(migrations.Migration):
model_name="preferences",
name="user",
field=models.OneToOneField(
related_name="_preferences", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="_preferences",
to=settings.AUTH_USER_MODEL,
),
),
]
......@@ -66,7 +66,10 @@ class Migration(migrations.Migration):
(
"user",
models.OneToOneField(
primary_key=True, serialize=False, to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
serialize=False,
to=settings.AUTH_USER_MODEL,
),
),
(
......
......@@ -2,6 +2,7 @@
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -32,6 +33,7 @@ class Migration(migrations.Migration):
(
"product",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="product",
related_name="eticket",
to="counter.Product",
......
......@@ -232,7 +232,9 @@ class Migration(migrations.Migration):
(
"user",
models.OneToOneField(
to=settings.AUTH_USER_MODEL, related_name="_forum_infos"
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
related_name="_forum_infos",
),
),
],
......
......@@ -26,6 +26,7 @@ class Migration(migrations.Migration):
(
"counter",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
related_name="launderette",
verbose_name="counter",
to="counter.Counter",
......
......@@ -86,6 +86,7 @@ class Migration(migrations.Migration):
(
"counter",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="counter",
related_name="stock",
to="counter.Counter",
......
......@@ -51,7 +51,14 @@ class Migration(migrations.Migration):
verbose_name="maximum characters",
),
),
("club", models.OneToOneField(to="club.Club", related_name="trombi")),
(
"club",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club",
related_name="trombi",
),
),
],
),
migrations.CreateModel(
......@@ -115,6 +122,7 @@ class Migration(migrations.Migration):
(
"user",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="trombi user",
to=settings.AUTH_USER_MODEL,
related_name="trombi_user",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment