mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 06:03:20 +00:00
django2.2: add on_delete on migrations for OneToOneField
This commit is contained in:
parent
3cb306bc91
commit
f7548ab8d1
@ -40,6 +40,7 @@ class Migration(migrations.Migration):
|
|||||||
model_name="operation",
|
model_name="operation",
|
||||||
name="linked_operation",
|
name="linked_operation",
|
||||||
field=models.OneToOneField(
|
field=models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
blank=True,
|
blank=True,
|
||||||
to="accounting.Operation",
|
to="accounting.Operation",
|
||||||
null=True,
|
null=True,
|
||||||
|
@ -36,6 +36,7 @@ class Migration(migrations.Migration):
|
|||||||
model_name="club",
|
model_name="club",
|
||||||
name="home",
|
name="home",
|
||||||
field=models.OneToOneField(
|
field=models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
related_name="home_of_club",
|
related_name="home_of_club",
|
||||||
|
@ -5,6 +5,7 @@ from django.db import migrations, models
|
|||||||
|
|
||||||
from club.models import Club
|
from club.models import Club
|
||||||
from core.operations import PsqlRunOnly
|
from core.operations import PsqlRunOnly
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
def generate_club_pages(apps, schema_editor):
|
def generate_club_pages(apps, schema_editor):
|
||||||
@ -31,7 +32,11 @@ class Migration(migrations.Migration):
|
|||||||
model_name="club",
|
model_name="club",
|
||||||
name="page",
|
name="page",
|
||||||
field=models.OneToOneField(
|
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(
|
migrations.AddField(
|
||||||
|
@ -277,6 +277,7 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"group_ptr",
|
"group_ptr",
|
||||||
models.OneToOneField(
|
models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
primary_key=True,
|
primary_key=True,
|
||||||
parent_link=True,
|
parent_link=True,
|
||||||
serialize=False,
|
serialize=False,
|
||||||
@ -431,7 +432,9 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"user",
|
"user",
|
||||||
models.OneToOneField(
|
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",
|
model_name="user",
|
||||||
name="home",
|
name="home",
|
||||||
field=models.OneToOneField(
|
field=models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
blank=True,
|
blank=True,
|
||||||
null=True,
|
null=True,
|
||||||
related_name="home_of",
|
related_name="home_of",
|
||||||
|
@ -3,6 +3,7 @@ from __future__ import unicode_literals
|
|||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -35,7 +36,9 @@ class Migration(migrations.Migration):
|
|||||||
model_name="preferences",
|
model_name="preferences",
|
||||||
name="user",
|
name="user",
|
||||||
field=models.OneToOneField(
|
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",
|
"user",
|
||||||
models.OneToOneField(
|
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 __future__ import unicode_literals
|
||||||
|
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
@ -32,6 +33,7 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"product",
|
"product",
|
||||||
models.OneToOneField(
|
models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
verbose_name="product",
|
verbose_name="product",
|
||||||
related_name="eticket",
|
related_name="eticket",
|
||||||
to="counter.Product",
|
to="counter.Product",
|
||||||
|
@ -232,7 +232,9 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"user",
|
"user",
|
||||||
models.OneToOneField(
|
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",
|
"counter",
|
||||||
models.OneToOneField(
|
models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
related_name="launderette",
|
related_name="launderette",
|
||||||
verbose_name="counter",
|
verbose_name="counter",
|
||||||
to="counter.Counter",
|
to="counter.Counter",
|
||||||
|
@ -86,6 +86,7 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"counter",
|
"counter",
|
||||||
models.OneToOneField(
|
models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
verbose_name="counter",
|
verbose_name="counter",
|
||||||
related_name="stock",
|
related_name="stock",
|
||||||
to="counter.Counter",
|
to="counter.Counter",
|
||||||
|
@ -51,7 +51,14 @@ class Migration(migrations.Migration):
|
|||||||
verbose_name="maximum characters",
|
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(
|
migrations.CreateModel(
|
||||||
@ -115,6 +122,7 @@ class Migration(migrations.Migration):
|
|||||||
(
|
(
|
||||||
"user",
|
"user",
|
||||||
models.OneToOneField(
|
models.OneToOneField(
|
||||||
|
on_delete=django.db.models.deletion.CASCADE,
|
||||||
verbose_name="trombi user",
|
verbose_name="trombi user",
|
||||||
to=settings.AUTH_USER_MODEL,
|
to=settings.AUTH_USER_MODEL,
|
||||||
related_name="trombi_user",
|
related_name="trombi_user",
|
||||||
|
Loading…
Reference in New Issue
Block a user