mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 17:31:09 -05:00
293 lines
14 KiB
Python
293 lines
14 KiB
Python
# Generated by Django 5.1.4 on 2025-02-10 01:10
|
|
|
|
import django.db.models.deletion
|
|
import pgtrigger.compiler
|
|
import pgtrigger.migrations
|
|
from django.db import migrations, models
|
|
|
|
PARKS_APP_MODEL = "parks.park"
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("companies", "0001_initial"),
|
|
("pghistory", "0006_delete_aggregateevent"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Park",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("name", models.CharField(max_length=255)),
|
|
("slug", models.SlugField(max_length=255, unique=True)),
|
|
("description", models.TextField(blank=True)),
|
|
(
|
|
"status",
|
|
models.CharField(
|
|
choices=[
|
|
("OPERATING", "Operating"),
|
|
("CLOSED_TEMP", "Temporarily Closed"),
|
|
("CLOSED_PERM", "Permanently Closed"),
|
|
("UNDER_CONSTRUCTION", "Under Construction"),
|
|
("DEMOLISHED", "Demolished"),
|
|
("RELOCATED", "Relocated"),
|
|
],
|
|
default="OPERATING",
|
|
max_length=20,
|
|
),
|
|
),
|
|
("opening_date", models.DateField(blank=True, null=True)),
|
|
("closing_date", models.DateField(blank=True, null=True)),
|
|
("operating_season", models.CharField(blank=True, max_length=255)),
|
|
(
|
|
"size_acres",
|
|
models.DecimalField(
|
|
blank=True, decimal_places=2, max_digits=10, null=True
|
|
),
|
|
),
|
|
("website", models.URLField(blank=True)),
|
|
(
|
|
"average_rating",
|
|
models.DecimalField(
|
|
blank=True, decimal_places=2, max_digits=3, null=True
|
|
),
|
|
),
|
|
("ride_count", models.IntegerField(blank=True, null=True)),
|
|
("coaster_count", models.IntegerField(blank=True, null=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"owner",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="parks",
|
|
to="companies.company",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="ParkArea",
|
|
fields=[
|
|
("id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
("name", models.CharField(max_length=255)),
|
|
("slug", models.SlugField(max_length=255)),
|
|
("description", models.TextField(blank=True)),
|
|
("opening_date", models.DateField(blank=True, null=True)),
|
|
("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_APP_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="ParkAreaEvent",
|
|
fields=[
|
|
("pgh_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("pgh_created_at", models.DateTimeField(auto_now_add=True)),
|
|
("pgh_label", models.TextField(help_text="The event label.")),
|
|
("id", models.BigIntegerField()),
|
|
("name", models.CharField(max_length=255)),
|
|
("slug", models.SlugField(db_index=False, max_length=255)),
|
|
("description", models.TextField(blank=True)),
|
|
("opening_date", models.DateField(blank=True, null=True)),
|
|
("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(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to=PARKS_APP_MODEL,
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to="parks.parkarea",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="ParkEvent",
|
|
fields=[
|
|
("pgh_id", models.AutoField(primary_key=True, serialize=False)),
|
|
("pgh_created_at", models.DateTimeField(auto_now_add=True)),
|
|
("pgh_label", models.TextField(help_text="The event label.")),
|
|
("id", models.BigIntegerField()),
|
|
("name", models.CharField(max_length=255)),
|
|
("slug", models.SlugField(db_index=False, max_length=255)),
|
|
("description", models.TextField(blank=True)),
|
|
(
|
|
"status",
|
|
models.CharField(
|
|
choices=[
|
|
("OPERATING", "Operating"),
|
|
("CLOSED_TEMP", "Temporarily Closed"),
|
|
("CLOSED_PERM", "Permanently Closed"),
|
|
("UNDER_CONSTRUCTION", "Under Construction"),
|
|
("DEMOLISHED", "Demolished"),
|
|
("RELOCATED", "Relocated"),
|
|
],
|
|
default="OPERATING",
|
|
max_length=20,
|
|
),
|
|
),
|
|
("opening_date", models.DateField(blank=True, null=True)),
|
|
("closing_date", models.DateField(blank=True, null=True)),
|
|
("operating_season", models.CharField(blank=True, max_length=255)),
|
|
(
|
|
"size_acres",
|
|
models.DecimalField(
|
|
blank=True, decimal_places=2, max_digits=10, null=True
|
|
),
|
|
),
|
|
("website", models.URLField(blank=True)),
|
|
(
|
|
"average_rating",
|
|
models.DecimalField(
|
|
blank=True, decimal_places=2, max_digits=3, null=True
|
|
),
|
|
),
|
|
("ride_count", models.IntegerField(blank=True, null=True)),
|
|
("coaster_count", models.IntegerField(blank=True, null=True)),
|
|
("created_at", models.DateTimeField(auto_now_add=True, null=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"owner",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
related_query_name="+",
|
|
to="companies.company",
|
|
),
|
|
),
|
|
(
|
|
"pgh_context",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="+",
|
|
to="pghistory.context",
|
|
),
|
|
),
|
|
(
|
|
"pgh_obj",
|
|
models.ForeignKey(
|
|
db_constraint=False,
|
|
on_delete=django.db.models.deletion.DO_NOTHING,
|
|
related_name="events",
|
|
to=PARKS_APP_MODEL,
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"abstract": False,
|
|
},
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="park",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "parks_parkevent" ("average_rating", "closing_date", "coaster_count", "created_at", "description", "id", "name", "opening_date", "operating_season", "owner_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_count", "size_acres", "slug", "status", "updated_at", "website") VALUES (NEW."average_rating", NEW."closing_date", NEW."coaster_count", NEW."created_at", NEW."description", NEW."id", NEW."name", NEW."opening_date", NEW."operating_season", NEW."owner_id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_count", NEW."size_acres", NEW."slug", NEW."status", NEW."updated_at", NEW."website"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_66883",
|
|
table="parks_park",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="park",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "parks_parkevent" ("average_rating", "closing_date", "coaster_count", "created_at", "description", "id", "name", "opening_date", "operating_season", "owner_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_count", "size_acres", "slug", "status", "updated_at", "website") VALUES (NEW."average_rating", NEW."closing_date", NEW."coaster_count", NEW."created_at", NEW."description", NEW."id", NEW."name", NEW."opening_date", NEW."operating_season", NEW."owner_id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_count", NEW."size_acres", NEW."slug", NEW."status", NEW."updated_at", NEW."website"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_19f56",
|
|
table="parks_park",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
migrations.AlterUniqueTogether(
|
|
name="parkarea",
|
|
unique_together={("park", "slug")},
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="parkarea",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="insert_insert",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
func='INSERT INTO "parks_parkareaevent" ("closing_date", "created_at", "description", "id", "name", "opening_date", "park_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "slug", "updated_at") VALUES (NEW."closing_date", NEW."created_at", NEW."description", NEW."id", NEW."name", NEW."opening_date", NEW."park_id", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."slug", NEW."updated_at"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="INSERT",
|
|
pgid="pgtrigger_insert_insert_13457",
|
|
table="parks_parkarea",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
pgtrigger.migrations.AddTrigger(
|
|
model_name="parkarea",
|
|
trigger=pgtrigger.compiler.Trigger(
|
|
name="update_update",
|
|
sql=pgtrigger.compiler.UpsertTriggerSql(
|
|
condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)",
|
|
func='INSERT INTO "parks_parkareaevent" ("closing_date", "created_at", "description", "id", "name", "opening_date", "park_id", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "slug", "updated_at") VALUES (NEW."closing_date", NEW."created_at", NEW."description", NEW."id", NEW."name", NEW."opening_date", NEW."park_id", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."slug", NEW."updated_at"); RETURN NULL;',
|
|
hash="[AWS-SECRET-REMOVED]",
|
|
operation="UPDATE",
|
|
pgid="pgtrigger_update_update_6e5aa",
|
|
table="parks_parkarea",
|
|
when="AFTER",
|
|
),
|
|
),
|
|
),
|
|
]
|