django2.2: add on_delete on migrations for ForeignKey

This commit is contained in:
Antoine Bartuccio 2019-10-06 00:32:54 +02:00
parent c20d5855e4
commit 3cb306bc91
Signed by: klmp200
GPG Key ID: E7245548C53F904B
30 changed files with 233 additions and 36 deletions

View File

@ -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,
),
),
],

View File

@ -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(

View File

@ -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,
),
),
],

View File

@ -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,
),
),
],

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):
@ -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(

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):
@ -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,

View File

@ -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",

View File

@ -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",

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):
@ -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",
),
),
],

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):
@ -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",

View File

@ -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,

View File

@ -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",

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):
@ -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,

View File

@ -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,
),
),
],

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):
@ -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,

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):
@ -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,

View File

@ -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,
),
),
],

View File

@ -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",

View File

@ -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",
),

View File

@ -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",

View File

@ -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(

View File

@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import accounting.models
from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration):
@ -27,6 +28,7 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
to=settings.AUTH_USER_MODEL,
related_name="baskets",
@ -62,7 +64,10 @@ class Migration(migrations.Migration):
(
"basket",
models.ForeignKey(
verbose_name="basket", to="eboutic.Basket", related_name="items"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="basket",
to="eboutic.Basket",
related_name="items",
),
),
],
@ -88,6 +93,7 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
to=settings.AUTH_USER_MODEL,
related_name="invoices",
@ -123,6 +129,7 @@ class Migration(migrations.Migration):
(
"invoice",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="invoice",
to="eboutic.Invoice",
related_name="items",

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):
@ -120,6 +121,7 @@ class Migration(migrations.Migration):
(
"election",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="election",
to="election.Election",
related_name="election_lists",
@ -151,6 +153,7 @@ class Migration(migrations.Migration):
(
"election",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="election",
to="election.Election",
related_name="roles",
@ -181,7 +184,10 @@ class Migration(migrations.Migration):
(
"role",
models.ForeignKey(
verbose_name="role", to="election.Role", related_name="votes"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="role",
to="election.Role",
related_name="votes",
),
),
],
@ -190,6 +196,7 @@ class Migration(migrations.Migration):
model_name="candidature",
name="election_list",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="election list",
to="election.ElectionList",
related_name="candidatures",
@ -199,13 +206,17 @@ class Migration(migrations.Migration):
model_name="candidature",
name="role",
field=models.ForeignKey(
verbose_name="role", to="election.Role", related_name="candidatures"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="role",
to="election.Role",
related_name="candidatures",
),
),
migrations.AddField(
model_name="candidature",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
to=settings.AUTH_USER_MODEL,
related_name="candidates",

View File

@ -6,6 +6,7 @@ from django.utils.timezone import utc
from django.conf import settings
import django.utils.timezone
import datetime
import django.db.models.deletion
class Migration(migrations.Migration):
@ -52,6 +53,7 @@ class Migration(migrations.Migration):
(
"owner_club",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club",
verbose_name="owner club",
related_name="owned_forums",
@ -61,7 +63,11 @@ class Migration(migrations.Migration):
(
"parent",
models.ForeignKey(
to="forum.Forum", null=True, related_name="children", blank=True
on_delete=django.db.models.deletion.CASCADE,
to="forum.Forum",
null=True,
related_name="children",
blank=True,
),
),
(
@ -103,7 +109,9 @@ class Migration(migrations.Migration):
(
"author",
models.ForeignKey(
related_name="forum_messages", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="forum_messages",
to=settings.AUTH_USER_MODEL,
),
),
(
@ -149,12 +157,18 @@ class Migration(migrations.Migration):
),
(
"message",
models.ForeignKey(related_name="metas", to="forum.ForumMessage"),
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="metas",
to="forum.ForumMessage",
),
),
(
"user",
models.ForeignKey(
related_name="forum_message_metas", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="forum_message_metas",
to=settings.AUTH_USER_MODEL,
),
),
],
@ -180,10 +194,19 @@ class Migration(migrations.Migration):
(
"author",
models.ForeignKey(
related_name="forum_topics", to=settings.AUTH_USER_MODEL
on_delete=django.db.models.deletion.CASCADE,
related_name="forum_topics",
to=settings.AUTH_USER_MODEL,
),
),
(
"forum",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="topics",
to="forum.Forum",
),
),
("forum", models.ForeignKey(related_name="topics", to="forum.Forum")),
],
options={"ordering": ["-id"]},
),
@ -217,6 +240,10 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="forummessage",
name="topic",
field=models.ForeignKey(related_name="messages", to="forum.ForumTopic"),
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="messages",
to="forum.ForumTopic",
),
),
]

View File

@ -2,6 +2,7 @@
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -61,6 +62,7 @@ class Migration(migrations.Migration):
(
"launderette",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="launderette",
to="launderette.Launderette",
related_name="machines",
@ -93,6 +95,7 @@ class Migration(migrations.Migration):
(
"machine",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="machine",
to="launderette.Machine",
related_name="slots",
@ -131,6 +134,7 @@ class Migration(migrations.Migration):
(
"launderette",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="launderette",
to="launderette.Launderette",
related_name="tokens",
@ -139,6 +143,7 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True,
related_name="tokens",
verbose_name="user",
@ -153,6 +158,7 @@ class Migration(migrations.Migration):
model_name="slot",
name="token",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True,
related_name="slots",
verbose_name="token",
@ -164,7 +170,10 @@ class Migration(migrations.Migration):
model_name="slot",
name="user",
field=models.ForeignKey(
verbose_name="user", to="core.User", related_name="slots"
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
to="core.User",
related_name="slots",
),
),
migrations.AlterUniqueTogether(

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",

View File

@ -132,7 +132,11 @@ class Migration(migrations.Migration):
),
(
"stock_owner",
models.ForeignKey(related_name="items", to="stock.Stock"),
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="items",
to="stock.Stock",
),
),
(
"type",
@ -151,7 +155,10 @@ class Migration(migrations.Migration):
model_name="shoppinglistitem",
name="stockitem_owner",
field=models.ForeignKey(
null=True, related_name="shopping_item", to="stock.StockItem"
on_delete=django.db.models.deletion.CASCADE,
null=True,
related_name="shopping_item",
to="stock.StockItem",
),
),
migrations.AddField(
@ -170,7 +177,10 @@ class Migration(migrations.Migration):
model_name="shoppinglist",
name="stock_owner",
field=models.ForeignKey(
null=True, related_name="shopping_lists", to="stock.Stock"
on_delete=django.db.models.deletion.CASCADE,
null=True,
related_name="shopping_lists",
to="stock.Stock",
),
),
]

View File

@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.auth.models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -79,6 +80,10 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name="subscription",
name="member",
field=models.ForeignKey(to="core.User", related_name="subscriptions"),
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="core.User",
related_name="subscriptions",
),
),
]

View File

@ -126,6 +126,7 @@ class Migration(migrations.Migration):
model_name="trombicomment",
name="author",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="trombi.TrombiUser",
verbose_name="author",
related_name="given_comments",
@ -135,6 +136,7 @@ class Migration(migrations.Migration):
model_name="trombicomment",
name="target",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="trombi.TrombiUser",
verbose_name="target",
related_name="received_comments",

View File

@ -2,6 +2,7 @@
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
@ -40,6 +41,7 @@ class Migration(migrations.Migration):
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user",
related_name="memberships",
to="trombi.TrombiUser",