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 from django.db import migrations, models
import django.core.validators import django.core.validators
import accounting.models import accounting.models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -243,6 +244,7 @@ class Migration(migrations.Migration):
verbose_name="accounting type", verbose_name="accounting type",
to="accounting.AccountingType", to="accounting.AccountingType",
blank=True, blank=True,
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
], ],
@ -267,6 +269,7 @@ class Migration(migrations.Migration):
verbose_name="simplified accounting types", verbose_name="simplified accounting types",
to="accounting.AccountingType", to="accounting.AccountingType",
related_name="simplified_types", related_name="simplified_types",
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
], ],

View File

@ -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):
@ -22,6 +23,7 @@ class Migration(migrations.Migration):
verbose_name="invoice", verbose_name="invoice",
to="core.SithFile", to="core.SithFile",
blank=True, blank=True,
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
migrations.AddField( migrations.AddField(
@ -31,6 +33,7 @@ class Migration(migrations.Migration):
verbose_name="journal", verbose_name="journal",
to="accounting.GeneralJournal", to="accounting.GeneralJournal",
related_name="operations", related_name="operations",
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
migrations.AddField( migrations.AddField(
@ -54,6 +57,7 @@ class Migration(migrations.Migration):
verbose_name="simple type", verbose_name="simple type",
to="accounting.SimplifiedAccountingType", to="accounting.SimplifiedAccountingType",
blank=True, blank=True,
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
migrations.AddField( migrations.AddField(
@ -63,6 +67,7 @@ class Migration(migrations.Migration):
verbose_name="club account", verbose_name="club account",
to="accounting.ClubAccount", to="accounting.ClubAccount",
related_name="journals", related_name="journals",
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
migrations.AddField( migrations.AddField(
@ -72,20 +77,27 @@ class Migration(migrations.Migration):
verbose_name="bank account", verbose_name="bank account",
to="accounting.BankAccount", to="accounting.BankAccount",
related_name="club_accounts", related_name="club_accounts",
on_delete=django.db.models.deletion.CASCADE,
), ),
), ),
migrations.AddField( migrations.AddField(
model_name="clubaccount", model_name="clubaccount",
name="club", name="club",
field=models.ForeignKey( 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( migrations.AddField(
model_name="bankaccount", model_name="bankaccount",
name="club", name="club",
field=models.ForeignKey( 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( migrations.AlterUniqueTogether(

View File

@ -29,6 +29,7 @@ class Migration(migrations.Migration):
related_name="labels", related_name="labels",
verbose_name="club account", verbose_name="club account",
to="accounting.ClubAccount", 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 from django.db import migrations, models
import django.core.validators import django.core.validators
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -90,7 +91,10 @@ class Migration(migrations.Migration):
( (
"club", "club",
models.ForeignKey( 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.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):
@ -18,6 +19,7 @@ class Migration(migrations.Migration):
model_name="membership", model_name="membership",
name="user", name="user",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user", verbose_name="user",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
related_name="membership", related_name="membership",
@ -45,14 +47,21 @@ class Migration(migrations.Migration):
model_name="club", model_name="club",
name="owner_group", name="owner_group",
field=models.ForeignKey( 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( migrations.AddField(
model_name="club", model_name="club",
name="parent", name="parent",
field=models.ForeignKey( 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( migrations.AddField(

View File

@ -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):
@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="membership", model_name="membership",
name="user", name="user",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user", verbose_name="user",
related_name="memberships", related_name="memberships",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,

View File

@ -5,6 +5,7 @@ from django.db import migrations, models
from django.conf import settings from django.conf import settings
import re import re
import django.core.validators import django.core.validators
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -51,12 +52,16 @@ class Migration(migrations.Migration):
( (
"club", "club",
models.ForeignKey( 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", "moderator",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True, null=True,
verbose_name="moderator", verbose_name="moderator",
related_name="moderated_mailings", related_name="moderated_mailings",
@ -84,6 +89,7 @@ class Migration(migrations.Migration):
( (
"mailing", "mailing",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="Mailing", verbose_name="Mailing",
related_name="subscriptions", related_name="subscriptions",
to="club.Mailing", to="club.Mailing",
@ -92,6 +98,7 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True, null=True,
verbose_name="User", verbose_name="User",
related_name="mailing_subscriptions", related_name="mailing_subscriptions",

View File

@ -3,6 +3,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import club.models import club.models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="club", model_name="club",
name="owner_group", name="owner_group",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
default=club.models.Club.get_default_owner_group, default=club.models.Club.get_default_owner_group,
related_name="owned_club", related_name="owned_club",
to="core.Group", to="core.Group",

View File

@ -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):
@ -50,6 +51,7 @@ class Migration(migrations.Migration):
( (
"author", "author",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="owned_news", related_name="owned_news",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
verbose_name="author", verbose_name="author",
@ -58,12 +60,16 @@ class Migration(migrations.Migration):
( (
"club", "club",
models.ForeignKey( 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", "moderator",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_news", related_name="moderated_news",
null=True, null=True,
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
@ -99,7 +105,10 @@ class Migration(migrations.Migration):
( (
"news", "news",
models.ForeignKey( 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.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):
@ -56,6 +57,7 @@ class Migration(migrations.Migration):
( (
"author", "author",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
verbose_name="author", verbose_name="author",
related_name="owned_weekmail_articles", related_name="owned_weekmail_articles",
@ -64,6 +66,7 @@ class Migration(migrations.Migration):
( (
"club", "club",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club", to="club.Club",
verbose_name="club", verbose_name="club",
related_name="weekmail_articles", related_name="weekmail_articles",
@ -72,6 +75,7 @@ class Migration(migrations.Migration):
( (
"weekmail", "weekmail",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="com.Weekmail", to="com.Weekmail",
verbose_name="weekmail", verbose_name="weekmail",
related_name="articles", related_name="articles",

View File

@ -4,6 +4,7 @@ from __future__ import unicode_literals
from django.db import migrations, models from django.db import migrations, models
import django.utils.timezone import django.utils.timezone
from django.conf import settings from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -48,12 +49,16 @@ class Migration(migrations.Migration):
( (
"club", "club",
models.ForeignKey( 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", "moderator",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="moderator", verbose_name="moderator",
blank=True, blank=True,
null=True, null=True,

View File

@ -8,6 +8,7 @@ import django.core.validators
import core.models import core.models
import phonenumber_field.modelfields import phonenumber_field.modelfields
from django.conf import settings from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -329,6 +330,7 @@ class Migration(migrations.Migration):
( (
"owner_group", "owner_group",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
default=1, default=1,
related_name="owned_page", related_name="owned_page",
verbose_name="owner group", verbose_name="owner group",
@ -390,10 +392,19 @@ class Migration(migrations.Migration):
( (
"author", "author",
models.ForeignKey( 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"]}, options={"ordering": ["date"]},
), ),
@ -469,6 +480,7 @@ class Migration(migrations.Migration):
( (
"owner", "owner",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="owner", verbose_name="owner",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
related_name="owned_files", related_name="owned_files",
@ -477,6 +489,7 @@ class Migration(migrations.Migration):
( (
"parent", "parent",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True, null=True,
related_name="children", related_name="children",
verbose_name="parent", verbose_name="parent",

View File

@ -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):
@ -21,6 +22,7 @@ class Migration(migrations.Migration):
model_name="page", model_name="page",
name="lock_user", name="lock_user",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="lock user", verbose_name="lock user",
default=None, default=None,
blank=True, blank=True,

View File

@ -4,6 +4,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.utils.timezone import django.utils.timezone
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -48,7 +49,9 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( 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.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):
@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="sithfile", model_name="sithfile",
name="moderator", name="moderator",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_files", related_name="moderated_files",
verbose_name="owner", verbose_name="owner",
default=0, default=0,

View File

@ -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):
@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="sithfile", model_name="sithfile",
name="moderator", name="moderator",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="moderated_files", related_name="moderated_files",
blank=True, blank=True,
null=True, null=True,

View File

@ -4,6 +4,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.utils.timezone import django.utils.timezone
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -33,7 +34,9 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( 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 from django.db import migrations, models
import core.models import core.models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -14,6 +15,7 @@ class Migration(migrations.Migration):
model_name="page", model_name="page",
name="owner_group", name="owner_group",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="owner group", verbose_name="owner group",
default=core.models.Page.get_default_owner_group, default=core.models.Page.get_default_owner_group,
related_name="owned_page", related_name="owned_page",

View File

@ -5,6 +5,7 @@ from django.db import migrations, models
import accounting.models import accounting.models
import django.db.models.deletion import django.db.models.deletion
from django.conf import settings from django.conf import settings
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -42,7 +43,14 @@ class Migration(migrations.Migration):
verbose_name="counter type", 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", "edit_groups",
models.ManyToManyField( models.ManyToManyField(
@ -97,13 +105,17 @@ class Migration(migrations.Migration):
( (
"counter", "counter",
models.ForeignKey( models.ForeignKey(
to="counter.Counter", related_name="permanencies" on_delete=django.db.models.deletion.CASCADE,
to="counter.Counter",
related_name="permanencies",
), ),
), ),
( (
"user", "user",
models.ForeignKey( 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", "club",
models.ForeignKey( 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", "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", "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", "operator",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
related_name="refillings_as_operator", related_name="refillings_as_operator",
), ),

View File

@ -4,6 +4,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 accounting.models import accounting.models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -35,6 +36,7 @@ class Migration(migrations.Migration):
( (
"counter", "counter",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="counter.Counter", to="counter.Counter",
related_name="cash_summaries", related_name="cash_summaries",
verbose_name="counter", verbose_name="counter",
@ -43,6 +45,7 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
related_name="cash_summaries", related_name="cash_summaries",
verbose_name="user", verbose_name="user",
@ -74,6 +77,7 @@ class Migration(migrations.Migration):
( (
"cash_summary", "cash_summary",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="counter.CashRegisterSummary", to="counter.CashRegisterSummary",
related_name="items", related_name="items",
verbose_name="cash summary", verbose_name="cash summary",
@ -86,6 +90,7 @@ class Migration(migrations.Migration):
model_name="permanency", model_name="permanency",
name="counter", name="counter",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="counter.Counter", to="counter.Counter",
related_name="permanencies", related_name="permanencies",
verbose_name="counter", verbose_name="counter",
@ -95,6 +100,7 @@ class Migration(migrations.Migration):
model_name="permanency", model_name="permanency",
name="user", name="user",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
related_name="permanencies", related_name="permanencies",
verbose_name="user", verbose_name="user",

View File

@ -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):
@ -13,7 +14,10 @@ class Migration(migrations.Migration):
model_name="counter", model_name="counter",
name="club", name="club",
field=models.ForeignKey( 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( migrations.AlterField(

View File

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

View File

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

View File

@ -6,6 +6,7 @@ from django.utils.timezone import utc
from django.conf import settings from django.conf import settings
import django.utils.timezone import django.utils.timezone
import datetime import datetime
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -52,6 +53,7 @@ class Migration(migrations.Migration):
( (
"owner_club", "owner_club",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="club.Club", to="club.Club",
verbose_name="owner club", verbose_name="owner club",
related_name="owned_forums", related_name="owned_forums",
@ -61,7 +63,11 @@ class Migration(migrations.Migration):
( (
"parent", "parent",
models.ForeignKey( 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", "author",
models.ForeignKey( 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", "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", "user",
models.ForeignKey( 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", "author",
models.ForeignKey( 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"]}, options={"ordering": ["-id"]},
), ),
@ -217,6 +240,10 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name="forummessage", model_name="forummessage",
name="topic", 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 __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):
@ -61,6 +62,7 @@ class Migration(migrations.Migration):
( (
"launderette", "launderette",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="launderette", verbose_name="launderette",
to="launderette.Launderette", to="launderette.Launderette",
related_name="machines", related_name="machines",
@ -93,6 +95,7 @@ class Migration(migrations.Migration):
( (
"machine", "machine",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="machine", verbose_name="machine",
to="launderette.Machine", to="launderette.Machine",
related_name="slots", related_name="slots",
@ -131,6 +134,7 @@ class Migration(migrations.Migration):
( (
"launderette", "launderette",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="launderette", verbose_name="launderette",
to="launderette.Launderette", to="launderette.Launderette",
related_name="tokens", related_name="tokens",
@ -139,6 +143,7 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True, null=True,
related_name="tokens", related_name="tokens",
verbose_name="user", verbose_name="user",
@ -153,6 +158,7 @@ class Migration(migrations.Migration):
model_name="slot", model_name="slot",
name="token", name="token",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
null=True, null=True,
related_name="slots", related_name="slots",
verbose_name="token", verbose_name="token",
@ -164,7 +170,10 @@ class Migration(migrations.Migration):
model_name="slot", model_name="slot",
name="user", name="user",
field=models.ForeignKey( 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( migrations.AlterUniqueTogether(

View File

@ -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):
@ -28,12 +29,16 @@ class Migration(migrations.Migration):
( (
"picture", "picture",
models.ForeignKey( 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", "user",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="pictures", related_name="pictures",
to=settings.AUTH_USER_MODEL, to=settings.AUTH_USER_MODEL,
verbose_name="user", verbose_name="user",

View File

@ -132,7 +132,11 @@ class Migration(migrations.Migration):
), ),
( (
"stock_owner", "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", "type",
@ -151,7 +155,10 @@ class Migration(migrations.Migration):
model_name="shoppinglistitem", model_name="shoppinglistitem",
name="stockitem_owner", name="stockitem_owner",
field=models.ForeignKey( 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( migrations.AddField(
@ -170,7 +177,10 @@ class Migration(migrations.Migration):
model_name="shoppinglist", model_name="shoppinglist",
name="stock_owner", name="stock_owner",
field=models.ForeignKey( 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 from django.db import migrations, models
import django.contrib.auth.models import django.contrib.auth.models
import django.db.models.deletion
class Migration(migrations.Migration): class Migration(migrations.Migration):
@ -79,6 +80,10 @@ class Migration(migrations.Migration):
migrations.AddField( migrations.AddField(
model_name="subscription", model_name="subscription",
name="member", 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", model_name="trombicomment",
name="author", name="author",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="trombi.TrombiUser", to="trombi.TrombiUser",
verbose_name="author", verbose_name="author",
related_name="given_comments", related_name="given_comments",
@ -135,6 +136,7 @@ class Migration(migrations.Migration):
model_name="trombicomment", model_name="trombicomment",
name="target", name="target",
field=models.ForeignKey( field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="trombi.TrombiUser", to="trombi.TrombiUser",
verbose_name="target", verbose_name="target",
related_name="received_comments", related_name="received_comments",

View File

@ -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):
@ -40,6 +41,7 @@ class Migration(migrations.Migration):
( (
"user", "user",
models.ForeignKey( models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
verbose_name="user", verbose_name="user",
related_name="memberships", related_name="memberships",
to="trombi.TrombiUser", to="trombi.TrombiUser",