Verified Commit 3cb306bc authored by Sli's avatar Sli
Browse files

django2.2: add on_delete on migrations for ForeignKey

parent c20d5855
......@@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
import accounting.models
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -243,6 +244,7 @@ class Migration(migrations.Migration):
verbose_name="accounting type",
to="accounting.AccountingType",
blank=True,
on_delete=django.db.models.deletion.CASCADE,
),
),
],
......@@ -267,6 +269,7 @@ class Migration(migrations.Migration):
verbose_name="simplified accounting types",
to="accounting.AccountingType",
related_name="simplified_types",
on_delete=django.db.models.deletion.CASCADE,
),
),
],
......
......@@ -2,6 +2,7 @@
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -22,6 +23,7 @@ class Migration(migrations.Migration):
verbose_name="invoice",
to="core.SithFile",
blank=True,
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
......@@ -31,6 +33,7 @@ class Migration(migrations.Migration):
verbose_name="journal",
to="accounting.GeneralJournal",
related_name="operations",
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
......@@ -54,6 +57,7 @@ class Migration(migrations.Migration):
verbose_name="simple type",
to="accounting.SimplifiedAccountingType",
blank=True,
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
......@@ -63,6 +67,7 @@ class Migration(migrations.Migration):
verbose_name="club account",
to="accounting.ClubAccount",
related_name="journals",
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
......@@ -72,20 +77,27 @@ class Migration(migrations.Migration):
verbose_name="bank account",
to="accounting.BankAccount",
related_name="club_accounts",
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
model_name="clubaccount",
name="club",
field=models.ForeignKey(
verbose_name="club", to="club.Club", related_name="club_account"
verbose_name="club",
to="club.Club",
related_name="club_account",
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AddField(
model_name="bankaccount",
name="club",
field=models.ForeignKey(
verbose_name="club", to="club.Club", related_name="bank_accounts"
verbose_name="club",
to="club.Club",
related_name="bank_accounts",
on_delete=django.db.models.deletion.CASCADE,
),
),
migrations.AlterUniqueTogether(
......
......@@ -29,6 +29,7 @@ class Migration(migrations.Migration):
related_name="labels",
verbose_name="club account",
to="accounting.ClubAccount",
on_delete=django.db.models.deletion.CASCADE,
),
),
],
......
......@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -90,7 +91,10 @@ class Migration(migrations.Migration):
(
"club",
models.ForeignKey(
verbose_name="club", to="club.Club", related_name="members"
verbose_name="club",
to="club.Club",
related_name="members",
on_delete=django.db.models.deletion.CASCADE,
),
),
],
......
......@@ -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):
......@@ -18,6 +19,7 @@ class Migration(migrations.Migration):
model_name="membership",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
to=settings.AUTH_USER_MODEL,
related_name="membership",
......@@ -45,14 +47,21 @@ class Migration(migrations.Migration):
model_name="club",
name="owner_group",
field=models.ForeignKey(
default=1, to="core.Group", related_name="owned_club"
on_delete=django.db.models.deletion.CASCADE,
default=1,
to="core.Group",
related_name="owned_club",
),
),
migrations.AddField(
model_name="club",
name="parent",
field=models.ForeignKey(
null=True, to="club.Club", related_name="children", blank=True
on_delete=django.db.models.deletion.CASCADE,
null=True,
to="club.Club",
related_name="children",
blank=True,
),
),
migrations.AddField(
......
......@@ -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):
......@@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="membership",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
related_name="memberships",
to=settings.AUTH_USER_MODEL,
......
......@@ -5,6 +5,7 @@ from django.db import migrations, models
from django.conf import settings
import re
import django.core.validators
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -51,12 +52,16 @@ class Migration(migrations.Migration):
(
"club",
models.ForeignKey(
verbose_name="Club", related_name="mailings", to="club.Club"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="Club",
related_name="mailings",
to="club.Club",
),
),
(
"moderator",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True,
verbose_name="moderator",
related_name="moderated_mailings",
......@@ -84,6 +89,7 @@ class Migration(migrations.Migration):
(
"mailing",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="Mailing",
related_name="subscriptions",
to="club.Mailing",
......@@ -92,6 +98,7 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True,
verbose_name="User",
related_name="mailing_subscriptions",
......
......@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import club.models
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="club",
name="owner_group",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
default=club.models.Club.get_default_owner_group,
related_name="owned_club",
to="core.Group",
......
......@@ -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):
......@@ -50,6 +51,7 @@ class Migration(migrations.Migration):
(
"author",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="owned_news",
to=settings.AUTH_USER_MODEL,
verbose_name="author",
......@@ -58,12 +60,16 @@ class Migration(migrations.Migration):
(
"club",
models.ForeignKey(
related_name="news", to="club.Club", verbose_name="club"
on_delete=django.db.models.deletion.CASCADE,
related_name="news",
to="club.Club",
verbose_name="club",
),
),
(
"moderator",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_news",
null=True,
to=settings.AUTH_USER_MODEL,
......@@ -99,7 +105,10 @@ class Migration(migrations.Migration):
(
"news",
models.ForeignKey(
related_name="dates", to="com.News", verbose_name="news_date"
on_delete=django.db.models.deletion.CASCADE,
related_name="dates",
to="com.News",
verbose_name="news_date",
),
),
],
......
......@@ -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):
......@@ -56,6 +57,7 @@ class Migration(migrations.Migration):
(
"author",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
verbose_name="author",
related_name="owned_weekmail_articles",
......@@ -64,6 +66,7 @@ class Migration(migrations.Migration):
(
"club",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club",
verbose_name="club",
related_name="weekmail_articles",
......@@ -72,6 +75,7 @@ class Migration(migrations.Migration):
(
"weekmail",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="com.Weekmail",
verbose_name="weekmail",
related_name="articles",
......
......@@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -48,12 +49,16 @@ class Migration(migrations.Migration):
(
"club",
models.ForeignKey(
verbose_name="club", related_name="posters", to="club.Club"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="club",
related_name="posters",
to="club.Club",
),
),
(
"moderator",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="moderator",
blank=True,
null=True,
......
......@@ -8,6 +8,7 @@ import django.core.validators
import core.models
import phonenumber_field.modelfields
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -329,6 +330,7 @@ class Migration(migrations.Migration):
(
"owner_group",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
default=1,
related_name="owned_page",
verbose_name="owner group",
......@@ -390,10 +392,19 @@ class Migration(migrations.Migration):
(
"author",
models.ForeignKey(
to=settings.AUTH_USER_MODEL, related_name="page_rev"
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
related_name="page_rev",
),
),
(
"page",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="core.Page",
related_name="revisions",
),
),
("page", models.ForeignKey(to="core.Page", related_name="revisions")),
],
options={"ordering": ["date"]},
),
......@@ -469,6 +480,7 @@ class Migration(migrations.Migration):
(
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="owner",
to=settings.AUTH_USER_MODEL,
related_name="owned_files",
......@@ -477,6 +489,7 @@ class Migration(migrations.Migration):
(
"parent",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True,
related_name="children",
verbose_name="parent",
......
......@@ -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):
......@@ -21,6 +22,7 @@ class Migration(migrations.Migration):
model_name="page",
name="lock_user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="lock user",
default=None,
blank=True,
......
......@@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.utils.timezone
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -48,7 +49,9 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
related_name="notifications", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="notifications",
to=settings.AUTH_USER_MODEL,
),
),
],
......
......@@ -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):
......@@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="sithfile",
name="moderator",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_files",
verbose_name="owner",
default=0,
......
......@@ -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):
......@@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="sithfile",
name="moderator",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_files",
blank=True,
null=True,
......
......@@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import django.utils.timezone
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -33,7 +34,9 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
related_name="gifts", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="gifts",
to=settings.AUTH_USER_MODEL,
),
),
],
......
......@@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import core.models
import django.db.models.deletion
class Migration(migrations.Migration):
......@@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="page",
name="owner_group",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="owner group",
default=core.models.Page.get_default_owner_group,
related_name="owned_page",
......
......@@ -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,