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:
pacnpal
2025-02-10 00:20:27 -05:00
parent 4b32580b13
commit 9ed28b15b4
3 changed files with 37 additions and 40 deletions

View File

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