mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 15:31:08 -05:00
Create initial migration for HistoricalSlug model; update foreign key references to use settings.AUTH_USER_MODEL and define unique constraints
This commit is contained in:
@@ -5,6 +5,8 @@ import pgtrigger.compiler
|
||||
import pgtrigger.migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
PARKS_APP_MODEL = "parks.park"
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -84,16 +86,16 @@ class Migration(migrations.Migration):
|
||||
("closing_date", models.DateField(blank=True, null=True)),
|
||||
("created_at", models.DateTimeField(auto_now_add=True, null=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
(
|
||||
"park",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="areas",
|
||||
to="parks.park",
|
||||
to=PARKS_APP_MODEL,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
options = {
|
||||
"ordering": ["name"],
|
||||
},
|
||||
),
|
||||
@@ -117,11 +119,11 @@ class Migration(migrations.Migration):
|
||||
db_constraint=False,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="+",
|
||||
related_query_name="+",
|
||||
to="parks.park",
|
||||
to=PARKS_APP_MODEL,
|
||||
),
|
||||
),
|
||||
(
|
||||
"pgh_context",
|
||||
"pgh_context",
|
||||
models.ForeignKey(
|
||||
db_constraint=False,
|
||||
@@ -214,11 +216,11 @@ class Migration(migrations.Migration):
|
||||
),
|
||||
(
|
||||
"pgh_obj",
|
||||
models.ForeignKey(
|
||||
db_constraint=False,
|
||||
on_delete=django.db.models.deletion.DO_NOTHING,
|
||||
related_name="events",
|
||||
to="parks.park",
|
||||
to=PARKS_APP_MODEL,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user