mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
django2.2: add on_delete on migrations for ForeignKey
This commit is contained in:
@ -5,6 +5,7 @@ from django.db import migrations, models
|
||||
import accounting.models
|
||||
import django.db.models.deletion
|
||||
from django.conf import settings
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -42,7 +43,14 @@ class Migration(migrations.Migration):
|
||||
verbose_name="counter type",
|
||||
),
|
||||
),
|
||||
("club", models.ForeignKey(to="club.Club", related_name="counters")),
|
||||
(
|
||||
"club",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="club.Club",
|
||||
related_name="counters",
|
||||
),
|
||||
),
|
||||
(
|
||||
"edit_groups",
|
||||
models.ManyToManyField(
|
||||
@ -97,13 +105,17 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(
|
||||
to="counter.Counter", related_name="permanencies"
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.Counter",
|
||||
related_name="permanencies",
|
||||
),
|
||||
),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
to=settings.AUTH_USER_MODEL, related_name="permanencies"
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="permanencies",
|
||||
),
|
||||
),
|
||||
],
|
||||
@ -169,7 +181,10 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"club",
|
||||
models.ForeignKey(
|
||||
verbose_name="club", to="club.Club", related_name="products"
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
verbose_name="club",
|
||||
to="club.Club",
|
||||
related_name="products",
|
||||
),
|
||||
),
|
||||
(
|
||||
@ -268,15 +283,24 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(to="counter.Counter", related_name="refillings"),
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.Counter",
|
||||
related_name="refillings",
|
||||
),
|
||||
),
|
||||
(
|
||||
"customer",
|
||||
models.ForeignKey(to="counter.Customer", related_name="refillings"),
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.Customer",
|
||||
related_name="refillings",
|
||||
),
|
||||
),
|
||||
(
|
||||
"operator",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="refillings_as_operator",
|
||||
),
|
||||
|
@ -4,6 +4,7 @@ from __future__ import unicode_literals
|
||||
from django.db import migrations, models
|
||||
from django.conf import settings
|
||||
import accounting.models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -35,6 +36,7 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"counter",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.Counter",
|
||||
related_name="cash_summaries",
|
||||
verbose_name="counter",
|
||||
@ -43,6 +45,7 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="cash_summaries",
|
||||
verbose_name="user",
|
||||
@ -74,6 +77,7 @@ class Migration(migrations.Migration):
|
||||
(
|
||||
"cash_summary",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.CashRegisterSummary",
|
||||
related_name="items",
|
||||
verbose_name="cash summary",
|
||||
@ -86,6 +90,7 @@ class Migration(migrations.Migration):
|
||||
model_name="permanency",
|
||||
name="counter",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to="counter.Counter",
|
||||
related_name="permanencies",
|
||||
verbose_name="counter",
|
||||
@ -95,6 +100,7 @@ class Migration(migrations.Migration):
|
||||
model_name="permanency",
|
||||
name="user",
|
||||
field=models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
related_name="permanencies",
|
||||
verbose_name="user",
|
||||
|
@ -2,6 +2,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@ -13,7 +14,10 @@ class Migration(migrations.Migration):
|
||||
model_name="counter",
|
||||
name="club",
|
||||
field=models.ForeignKey(
|
||||
verbose_name="club", to="club.Club", related_name="counters"
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
verbose_name="club",
|
||||
to="club.Club",
|
||||
related_name="counters",
|
||||
),
|
||||
),
|
||||
migrations.AlterField(
|
||||
|
Reference in New Issue
Block a user