# Generated by Django 5.2.6 on 2025-09-21 01:27 import apps.core.choices.fields import django.contrib.postgres.fields import django.core.validators import django.db.models.deletion import django.db.models.functions.datetime import django.utils.timezone import pgtrigger.compiler import pgtrigger.migrations from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("django_cloudflareimages_toolkit", "__first__"), ("parks", "0001_initial"), ("pghistory", "0007_auto_20250421_0444"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="Company", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("name", models.CharField(max_length=255)), ("slug", models.SlugField(max_length=255, unique=True)), ( "roles", django.contrib.postgres.fields.ArrayField( base_field=apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="company_roles", choices=[ ("MANUFACTURER", "Ride Manufacturer"), ("DESIGNER", "Ride Designer"), ], domain="rides", max_length=20, ), blank=True, default=list, size=None, ), ), ("description", models.TextField(blank=True)), ("website", models.URLField(blank=True)), ("founded_date", models.DateField(blank=True, null=True)), ("rides_count", models.IntegerField(default=0)), ("coasters_count", models.IntegerField(default=0)), ( "url", models.URLField( blank=True, help_text="Frontend URL for this company" ), ), ], options={ "verbose_name_plural": "Companies", "ordering": ["name"], "abstract": False, }, ), migrations.CreateModel( name="CompanyEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("name", models.CharField(max_length=255)), ("slug", models.SlugField(db_index=False, max_length=255)), ( "roles", django.contrib.postgres.fields.ArrayField( base_field=apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="company_roles", choices=[ ("MANUFACTURER", "Ride Manufacturer"), ("DESIGNER", "Ride Designer"), ], domain="rides", max_length=20, ), blank=True, default=list, size=None, ), ), ("description", models.TextField(blank=True)), ("website", models.URLField(blank=True)), ("founded_date", models.DateField(blank=True, null=True)), ("rides_count", models.IntegerField(default=0)), ("coasters_count", models.IntegerField(default=0)), ( "url", models.URLField( blank=True, help_text="Frontend URL for this company" ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RankingSnapshot", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("rank", models.PositiveIntegerField()), ( "winning_percentage", models.DecimalField(decimal_places=4, max_digits=5), ), ( "snapshot_date", models.DateField( db_index=True, help_text="Date when this ranking snapshot was taken", ), ), ], options={ "ordering": ["-snapshot_date", "rank"], }, ), migrations.CreateModel( name="Ride", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("name", models.CharField(max_length=255)), ("slug", models.SlugField(max_length=255)), ("description", models.TextField(blank=True)), ( "category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="categories", choices=[ ("RC", "Roller Coaster"), ("DR", "Dark Ride"), ("FR", "Flat Ride"), ("WR", "Water Ride"), ("TR", "Transport Ride"), ("OT", "Other"), ], default="", domain="rides", help_text="Ride category classification", max_length=2, ), ), ( "status", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="statuses", choices=[ ("OPERATING", "Operating"), ("CLOSED_TEMP", "Temporarily Closed"), ("SBNO", "Standing But Not Operating"), ("CLOSING", "Closing"), ("CLOSED_PERM", "Permanently Closed"), ("UNDER_CONSTRUCTION", "Under Construction"), ("DEMOLISHED", "Demolished"), ("RELOCATED", "Relocated"), ], default="OPERATING", domain="rides", help_text="Current operational status of the ride", max_length=20, ), ), ( "post_closing_status", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="post_closing_statuses", choices=[ ("SBNO", "Standing But Not Operating"), ("CLOSED_PERM", "Permanently Closed"), ], domain="rides", help_text="Status to change to after closing date", max_length=20, null=True, ), ), ("opening_date", models.DateField(blank=True, null=True)), ("closing_date", models.DateField(blank=True, null=True)), ("status_since", models.DateField(blank=True, null=True)), ("min_height_in", models.PositiveIntegerField(blank=True, null=True)), ("max_height_in", models.PositiveIntegerField(blank=True, null=True)), ( "capacity_per_hour", models.PositiveIntegerField(blank=True, null=True), ), ( "ride_duration_seconds", models.PositiveIntegerField(blank=True, null=True), ), ( "average_rating", models.DecimalField( blank=True, decimal_places=2, max_digits=3, null=True ), ), ( "opening_year", models.IntegerField(blank=True, db_index=True, null=True), ), ("search_text", models.TextField(blank=True, db_index=True)), ( "url", models.URLField(blank=True, help_text="Frontend URL for this ride"), ), ( "park_url", models.URLField( blank=True, help_text="Frontend URL for this ride's park" ), ), ], options={ "ordering": ["name"], "abstract": False, }, ), migrations.CreateModel( name="RideEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("name", models.CharField(max_length=255)), ("slug", models.SlugField(db_index=False, max_length=255)), ("description", models.TextField(blank=True)), ( "category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="categories", choices=[ ("RC", "Roller Coaster"), ("DR", "Dark Ride"), ("FR", "Flat Ride"), ("WR", "Water Ride"), ("TR", "Transport Ride"), ("OT", "Other"), ], default="", domain="rides", help_text="Ride category classification", max_length=2, ), ), ( "status", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="statuses", choices=[ ("OPERATING", "Operating"), ("CLOSED_TEMP", "Temporarily Closed"), ("SBNO", "Standing But Not Operating"), ("CLOSING", "Closing"), ("CLOSED_PERM", "Permanently Closed"), ("UNDER_CONSTRUCTION", "Under Construction"), ("DEMOLISHED", "Demolished"), ("RELOCATED", "Relocated"), ], default="OPERATING", domain="rides", help_text="Current operational status of the ride", max_length=20, ), ), ( "post_closing_status", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="post_closing_statuses", choices=[ ("SBNO", "Standing But Not Operating"), ("CLOSED_PERM", "Permanently Closed"), ], domain="rides", help_text="Status to change to after closing date", max_length=20, null=True, ), ), ("opening_date", models.DateField(blank=True, null=True)), ("closing_date", models.DateField(blank=True, null=True)), ("status_since", models.DateField(blank=True, null=True)), ("min_height_in", models.PositiveIntegerField(blank=True, null=True)), ("max_height_in", models.PositiveIntegerField(blank=True, null=True)), ( "capacity_per_hour", models.PositiveIntegerField(blank=True, null=True), ), ( "ride_duration_seconds", models.PositiveIntegerField(blank=True, null=True), ), ( "average_rating", models.DecimalField( blank=True, decimal_places=2, max_digits=3, null=True ), ), ("opening_year", models.IntegerField(blank=True, null=True)), ("search_text", models.TextField(blank=True)), ( "url", models.URLField(blank=True, help_text="Frontend URL for this ride"), ), ( "park_url", models.URLField( blank=True, help_text="Frontend URL for this ride's park" ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideLocation", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("point", models.CharField(blank=True, max_length=50, null=True)), ( "park_area", models.CharField( blank=True, db_index=True, help_text="Themed area or land within the park (e.g., 'Frontierland', 'Tomorrowland')", max_length=100, ), ), ( "notes", models.TextField(blank=True, help_text="General location notes"), ), ( "entrance_notes", models.TextField( blank=True, help_text="Directions to ride entrance, queue location, or navigation tips", ), ), ( "accessibility_notes", models.TextField( blank=True, help_text="Information about accessible entrances, wheelchair access, etc.", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ], options={ "verbose_name": "Ride Location", "verbose_name_plural": "Ride Locations", "ordering": ["ride__name"], }, ), migrations.CreateModel( name="RideLocationEvent", 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()), ("point", models.CharField(blank=True, max_length=50, null=True)), ( "park_area", models.CharField( blank=True, help_text="Themed area or land within the park (e.g., 'Frontierland', 'Tomorrowland')", max_length=100, ), ), ( "notes", models.TextField(blank=True, help_text="General location notes"), ), ( "entrance_notes", models.TextField( blank=True, help_text="Directions to ride entrance, queue location, or navigation tips", ), ), ( "accessibility_notes", models.TextField( blank=True, help_text="Information about accessible entrances, wheelchair access, etc.", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideModel", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "name", models.CharField( help_text="Name of the ride model", max_length=255 ), ), ( "slug", models.SlugField( help_text="URL-friendly identifier (unique within manufacturer)", max_length=255, ), ), ( "description", models.TextField( blank=True, help_text="Detailed description of the ride model" ), ), ( "category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="categories", choices=[ ("RC", "Roller Coaster"), ("DR", "Dark Ride"), ("FR", "Flat Ride"), ("WR", "Water Ride"), ("TR", "Transport Ride"), ("OT", "Other"), ], default="", domain="rides", help_text="Primary category classification", max_length=2, ), ), ( "typical_height_range_min_ft", models.DecimalField( blank=True, decimal_places=2, help_text="Minimum typical height in feet for this model", max_digits=6, null=True, ), ), ( "typical_height_range_max_ft", models.DecimalField( blank=True, decimal_places=2, help_text="Maximum typical height in feet for this model", max_digits=6, null=True, ), ), ( "typical_speed_range_min_mph", models.DecimalField( blank=True, decimal_places=2, help_text="Minimum typical speed in mph for this model", max_digits=5, null=True, ), ), ( "typical_speed_range_max_mph", models.DecimalField( blank=True, decimal_places=2, help_text="Maximum typical speed in mph for this model", max_digits=5, null=True, ), ), ( "typical_capacity_range_min", models.PositiveIntegerField( blank=True, help_text="Minimum typical hourly capacity for this model", null=True, ), ), ( "typical_capacity_range_max", models.PositiveIntegerField( blank=True, help_text="Maximum typical hourly capacity for this model", null=True, ), ), ( "track_type", models.CharField( blank=True, help_text="Type of track system (e.g., tubular steel, I-Box, wooden)", max_length=100, ), ), ( "support_structure", models.CharField( blank=True, help_text="Type of support structure (e.g., steel, wooden, hybrid)", max_length=100, ), ), ( "train_configuration", models.CharField( blank=True, help_text="Typical train configuration (e.g., 2 trains, 7 cars per train, 4 seats per car)", max_length=200, ), ), ( "restraint_system", models.CharField( blank=True, help_text="Type of restraint system (e.g., over-shoulder, lap bar, vest)", max_length=100, ), ), ( "first_installation_year", models.PositiveIntegerField( blank=True, help_text="Year of first installation of this model", null=True, ), ), ( "last_installation_year", models.PositiveIntegerField( blank=True, help_text="Year of last installation of this model (if discontinued)", null=True, ), ), ( "is_discontinued", models.BooleanField( default=False, help_text="Whether this model is no longer being manufactured", ), ), ( "total_installations", models.PositiveIntegerField( default=0, help_text="Total number of installations worldwide (auto-calculated)", ), ), ( "notable_features", models.TextField( blank=True, help_text="Notable design features or innovations (JSON or comma-separated)", ), ), ( "target_market", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="target_markets", choices=[ ("FAMILY", "Family"), ("THRILL", "Thrill"), ("EXTREME", "Extreme"), ("KIDDIE", "Kiddie"), ("ALL_AGES", "All Ages"), ], domain="rides", help_text="Primary target market for this ride model", max_length=50, ), ), ( "meta_title", models.CharField( blank=True, help_text="SEO meta title (auto-generated if blank)", max_length=60, ), ), ( "meta_description", models.CharField( blank=True, help_text="SEO meta description (auto-generated if blank)", max_length=160, ), ), ( "url", models.URLField( blank=True, help_text="Frontend URL for this ride model" ), ), ], options={ "ordering": ["manufacturer__name", "name"], "abstract": False, }, ), migrations.CreateModel( name="RideModelEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "name", models.CharField( help_text="Name of the ride model", max_length=255 ), ), ( "slug", models.SlugField( db_index=False, help_text="URL-friendly identifier (unique within manufacturer)", max_length=255, ), ), ( "description", models.TextField( blank=True, help_text="Detailed description of the ride model" ), ), ( "category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="categories", choices=[ ("RC", "Roller Coaster"), ("DR", "Dark Ride"), ("FR", "Flat Ride"), ("WR", "Water Ride"), ("TR", "Transport Ride"), ("OT", "Other"), ], default="", domain="rides", help_text="Primary category classification", max_length=2, ), ), ( "typical_height_range_min_ft", models.DecimalField( blank=True, decimal_places=2, help_text="Minimum typical height in feet for this model", max_digits=6, null=True, ), ), ( "typical_height_range_max_ft", models.DecimalField( blank=True, decimal_places=2, help_text="Maximum typical height in feet for this model", max_digits=6, null=True, ), ), ( "typical_speed_range_min_mph", models.DecimalField( blank=True, decimal_places=2, help_text="Minimum typical speed in mph for this model", max_digits=5, null=True, ), ), ( "typical_speed_range_max_mph", models.DecimalField( blank=True, decimal_places=2, help_text="Maximum typical speed in mph for this model", max_digits=5, null=True, ), ), ( "typical_capacity_range_min", models.PositiveIntegerField( blank=True, help_text="Minimum typical hourly capacity for this model", null=True, ), ), ( "typical_capacity_range_max", models.PositiveIntegerField( blank=True, help_text="Maximum typical hourly capacity for this model", null=True, ), ), ( "track_type", models.CharField( blank=True, help_text="Type of track system (e.g., tubular steel, I-Box, wooden)", max_length=100, ), ), ( "support_structure", models.CharField( blank=True, help_text="Type of support structure (e.g., steel, wooden, hybrid)", max_length=100, ), ), ( "train_configuration", models.CharField( blank=True, help_text="Typical train configuration (e.g., 2 trains, 7 cars per train, 4 seats per car)", max_length=200, ), ), ( "restraint_system", models.CharField( blank=True, help_text="Type of restraint system (e.g., over-shoulder, lap bar, vest)", max_length=100, ), ), ( "first_installation_year", models.PositiveIntegerField( blank=True, help_text="Year of first installation of this model", null=True, ), ), ( "last_installation_year", models.PositiveIntegerField( blank=True, help_text="Year of last installation of this model (if discontinued)", null=True, ), ), ( "is_discontinued", models.BooleanField( default=False, help_text="Whether this model is no longer being manufactured", ), ), ( "total_installations", models.PositiveIntegerField( default=0, help_text="Total number of installations worldwide (auto-calculated)", ), ), ( "notable_features", models.TextField( blank=True, help_text="Notable design features or innovations (JSON or comma-separated)", ), ), ( "target_market", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="target_markets", choices=[ ("FAMILY", "Family"), ("THRILL", "Thrill"), ("EXTREME", "Extreme"), ("KIDDIE", "Kiddie"), ("ALL_AGES", "All Ages"), ], domain="rides", help_text="Primary target market for this ride model", max_length=50, ), ), ( "meta_title", models.CharField( blank=True, help_text="SEO meta title (auto-generated if blank)", max_length=60, ), ), ( "meta_description", models.CharField( blank=True, help_text="SEO meta description (auto-generated if blank)", max_length=160, ), ), ( "url", models.URLField( blank=True, help_text="Frontend URL for this ride model" ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideModelPhoto", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("caption", models.CharField(blank=True, max_length=500)), ("alt_text", models.CharField(blank=True, max_length=255)), ( "photo_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="photo_types", choices=[ ("PROMOTIONAL", "Promotional"), ("TECHNICAL", "Technical Drawing"), ("INSTALLATION", "Installation Example"), ("RENDERING", "3D Rendering"), ("CATALOG", "Catalog Image"), ], default="PROMOTIONAL", domain="rides", help_text="Type of photo for categorization and display purposes", max_length=20, ), ), ( "is_primary", models.BooleanField( default=False, help_text="Whether this is the primary photo for the ride model", ), ), ("photographer", models.CharField(blank=True, max_length=255)), ("source", models.CharField(blank=True, max_length=255)), ("copyright_info", models.CharField(blank=True, max_length=255)), ], options={ "ordering": ["-is_primary", "-created_at"], "abstract": False, }, ), migrations.CreateModel( name="RideModelPhotoEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("caption", models.CharField(blank=True, max_length=500)), ("alt_text", models.CharField(blank=True, max_length=255)), ( "photo_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="photo_types", choices=[ ("PROMOTIONAL", "Promotional"), ("TECHNICAL", "Technical Drawing"), ("INSTALLATION", "Installation Example"), ("RENDERING", "3D Rendering"), ("CATALOG", "Catalog Image"), ], default="PROMOTIONAL", domain="rides", help_text="Type of photo for categorization and display purposes", max_length=20, ), ), ( "is_primary", models.BooleanField( default=False, help_text="Whether this is the primary photo for the ride model", ), ), ("photographer", models.CharField(blank=True, max_length=255)), ("source", models.CharField(blank=True, max_length=255)), ("copyright_info", models.CharField(blank=True, max_length=255)), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideModelTechnicalSpec", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "spec_category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="spec_categories", choices=[ ("DIMENSIONS", "Dimensions"), ("PERFORMANCE", "Performance"), ("CAPACITY", "Capacity"), ("SAFETY", "Safety Features"), ("ELECTRICAL", "Electrical Requirements"), ("FOUNDATION", "Foundation Requirements"), ("MAINTENANCE", "Maintenance"), ("OTHER", "Other"), ], domain="rides", help_text="Category of technical specification", max_length=50, ), ), ( "spec_name", models.CharField( help_text="Name of the specification", max_length=100 ), ), ( "spec_value", models.CharField( help_text="Value of the specification", max_length=255 ), ), ( "spec_unit", models.CharField( blank=True, help_text="Unit of measurement", max_length=20 ), ), ( "notes", models.TextField( blank=True, help_text="Additional notes about this specification", ), ), ], options={ "ordering": ["spec_category", "spec_name"], "abstract": False, }, ), migrations.CreateModel( name="RideModelTechnicalSpecEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "spec_category", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="spec_categories", choices=[ ("DIMENSIONS", "Dimensions"), ("PERFORMANCE", "Performance"), ("CAPACITY", "Capacity"), ("SAFETY", "Safety Features"), ("ELECTRICAL", "Electrical Requirements"), ("FOUNDATION", "Foundation Requirements"), ("MAINTENANCE", "Maintenance"), ("OTHER", "Other"), ], domain="rides", help_text="Category of technical specification", max_length=50, ), ), ( "spec_name", models.CharField( help_text="Name of the specification", max_length=100 ), ), ( "spec_value", models.CharField( help_text="Value of the specification", max_length=255 ), ), ( "spec_unit", models.CharField( blank=True, help_text="Unit of measurement", max_length=20 ), ), ( "notes", models.TextField( blank=True, help_text="Additional notes about this specification", ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideModelVariant", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "name", models.CharField(help_text="Name of this variant", max_length=255), ), ( "description", models.TextField( blank=True, help_text="Description of variant differences" ), ), ( "min_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "max_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "min_speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ( "max_speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ( "distinguishing_features", models.TextField( blank=True, help_text="What makes this variant unique from the base model", ), ), ], options={ "ordering": ["ride_model", "name"], "abstract": False, }, ), migrations.CreateModel( name="RideModelVariantEvent", 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()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "name", models.CharField(help_text="Name of this variant", max_length=255), ), ( "description", models.TextField( blank=True, help_text="Description of variant differences" ), ), ( "min_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "max_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "min_speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ( "max_speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ( "distinguishing_features", models.TextField( blank=True, help_text="What makes this variant unique from the base model", ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RidePairComparison", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "ride_a_wins", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated ride_a higher", ), ), ( "ride_b_wins", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated ride_b higher", ), ), ( "ties", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated both rides equally", ), ), ( "mutual_riders_count", models.PositiveIntegerField( default=0, help_text="Total number of users who have rated both rides", ), ), ( "ride_a_avg_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating of ride_a from mutual riders", max_digits=3, null=True, ), ), ( "ride_b_avg_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating of ride_b from mutual riders", max_digits=3, null=True, ), ), ( "last_calculated", models.DateTimeField( auto_now=True, help_text="When this comparison was last calculated", ), ), ], ), migrations.CreateModel( name="RidePairComparisonEvent", 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()), ( "ride_a_wins", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated ride_a higher", ), ), ( "ride_b_wins", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated ride_b higher", ), ), ( "ties", models.PositiveIntegerField( default=0, help_text="Number of mutual riders who rated both rides equally", ), ), ( "mutual_riders_count", models.PositiveIntegerField( default=0, help_text="Total number of users who have rated both rides", ), ), ( "ride_a_avg_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating of ride_a from mutual riders", max_digits=3, null=True, ), ), ( "ride_b_avg_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating of ride_b from mutual riders", max_digits=3, null=True, ), ), ( "last_calculated", models.DateTimeField( auto_now=True, help_text="When this comparison was last calculated", ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RidePhoto", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("caption", models.CharField(blank=True, max_length=255)), ("alt_text", models.CharField(blank=True, max_length=255)), ("is_primary", models.BooleanField(default=False)), ("is_approved", models.BooleanField(default=False)), ( "photo_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="photo_types", choices=[ ("PROMOTIONAL", "Promotional"), ("TECHNICAL", "Technical Drawing"), ("INSTALLATION", "Installation Example"), ("RENDERING", "3D Rendering"), ("CATALOG", "Catalog Image"), ], default="exterior", domain="rides", help_text="Type of photo for categorization and display purposes", max_length=50, ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("date_taken", models.DateTimeField(blank=True, null=True)), ], options={ "ordering": ["-is_primary", "-created_at"], "abstract": False, }, ), migrations.CreateModel( name="RidePhotoEvent", 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()), ("caption", models.CharField(blank=True, max_length=255)), ("alt_text", models.CharField(blank=True, max_length=255)), ("is_primary", models.BooleanField(default=False)), ("is_approved", models.BooleanField(default=False)), ( "photo_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="photo_types", choices=[ ("PROMOTIONAL", "Promotional"), ("TECHNICAL", "Technical Drawing"), ("INSTALLATION", "Installation Example"), ("RENDERING", "3D Rendering"), ("CATALOG", "Catalog Image"), ], default="exterior", domain="rides", help_text="Type of photo for categorization and display purposes", max_length=50, ), ), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("date_taken", models.DateTimeField(blank=True, null=True)), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideRanking", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "rank", models.PositiveIntegerField( db_index=True, help_text="Overall rank position (1 = best)" ), ), ( "wins", models.PositiveIntegerField( default=0, help_text="Number of rides this ride beats in pairwise comparisons", ), ), ( "losses", models.PositiveIntegerField( default=0, help_text="Number of rides that beat this ride in pairwise comparisons", ), ), ( "ties", models.PositiveIntegerField( default=0, help_text="Number of rides with equal preference in pairwise comparisons", ), ), ( "winning_percentage", models.DecimalField( db_index=True, decimal_places=4, help_text="Win percentage where ties count as 0.5", max_digits=5, validators=[ django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1), ], ), ), ( "mutual_riders_count", models.PositiveIntegerField( default=0, help_text="Total number of users who have rated this ride", ), ), ( "comparison_count", models.PositiveIntegerField( default=0, help_text="Number of other rides this was compared against", ), ), ( "average_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating from all users who have rated this ride", max_digits=3, null=True, validators=[ django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10), ], ), ), ( "last_calculated", models.DateTimeField( default=django.utils.timezone.now, help_text="When this ranking was last calculated", ), ), ( "calculation_version", models.CharField( default="1.0", help_text="Algorithm version used for calculation", max_length=10, ), ), ], options={ "ordering": ["rank"], }, ), migrations.CreateModel( name="RideRankingEvent", 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()), ( "rank", models.PositiveIntegerField( help_text="Overall rank position (1 = best)" ), ), ( "wins", models.PositiveIntegerField( default=0, help_text="Number of rides this ride beats in pairwise comparisons", ), ), ( "losses", models.PositiveIntegerField( default=0, help_text="Number of rides that beat this ride in pairwise comparisons", ), ), ( "ties", models.PositiveIntegerField( default=0, help_text="Number of rides with equal preference in pairwise comparisons", ), ), ( "winning_percentage", models.DecimalField( decimal_places=4, help_text="Win percentage where ties count as 0.5", max_digits=5, validators=[ django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1), ], ), ), ( "mutual_riders_count", models.PositiveIntegerField( default=0, help_text="Total number of users who have rated this ride", ), ), ( "comparison_count", models.PositiveIntegerField( default=0, help_text="Number of other rides this was compared against", ), ), ( "average_rating", models.DecimalField( blank=True, decimal_places=2, help_text="Average rating from all users who have rated this ride", max_digits=3, null=True, validators=[ django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10), ], ), ), ( "last_calculated", models.DateTimeField( default=django.utils.timezone.now, help_text="When this ranking was last calculated", ), ), ( "calculation_version", models.CharField( default="1.0", help_text="Algorithm version used for calculation", max_length=10, ), ), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RideReview", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "rating", models.PositiveSmallIntegerField( validators=[ django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10), ] ), ), ("title", models.CharField(max_length=200)), ("content", models.TextField()), ("visit_date", models.DateField()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("is_published", models.BooleanField(default=True)), ("moderation_notes", models.TextField(blank=True)), ("moderated_at", models.DateTimeField(blank=True, null=True)), ], options={ "ordering": ["-created_at"], "abstract": False, }, ), migrations.CreateModel( name="RideReviewEvent", 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()), ( "rating", models.PositiveSmallIntegerField( validators=[ django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(10), ] ), ), ("title", models.CharField(max_length=200)), ("content", models.TextField()), ("visit_date", models.DateField()), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ("is_published", models.BooleanField(default=True)), ("moderation_notes", models.TextField(blank=True)), ("moderated_at", models.DateTimeField(blank=True, null=True)), ], options={ "abstract": False, }, ), migrations.CreateModel( name="RollerCoasterStats", fields=[ ( "id", models.BigAutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ( "height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "length_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=7, null=True ), ), ( "speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ("inversions", models.PositiveIntegerField(default=0)), ( "ride_time_seconds", models.PositiveIntegerField(blank=True, null=True), ), ("track_type", models.CharField(blank=True, max_length=255)), ( "track_material", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="track_materials", choices=[ ("STEEL", "Steel"), ("WOOD", "Wood"), ("HYBRID", "Hybrid"), ], default="STEEL", domain="rides", help_text="Track construction material type", max_length=20, ), ), ( "roller_coaster_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="coaster_types", choices=[ ("SITDOWN", "Sit Down"), ("INVERTED", "Inverted"), ("FLYING", "Flying"), ("STANDUP", "Stand Up"), ("WING", "Wing"), ("DIVE", "Dive"), ("FAMILY", "Family"), ("WILD_MOUSE", "Wild Mouse"), ("SPINNING", "Spinning"), ("FOURTH_DIMENSION", "4th Dimension"), ("OTHER", "Other"), ], default="SITDOWN", domain="rides", help_text="Roller coaster type classification", max_length=20, ), ), ( "max_drop_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "propulsion_system", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="propulsion_systems", choices=[ ("CHAIN", "Chain Lift"), ("LSM", "LSM Launch"), ("HYDRAULIC", "Hydraulic Launch"), ("GRAVITY", "Gravity"), ("OTHER", "Other"), ], default="CHAIN", domain="rides", help_text="Propulsion or lift system type", max_length=20, ), ), ("train_style", models.CharField(blank=True, max_length=255)), ("trains_count", models.PositiveIntegerField(blank=True, null=True)), ("cars_per_train", models.PositiveIntegerField(blank=True, null=True)), ("seats_per_car", models.PositiveIntegerField(blank=True, null=True)), ], options={ "verbose_name": "Roller Coaster Statistics", "verbose_name_plural": "Roller Coaster Statistics", }, ), migrations.CreateModel( name="RollerCoasterStatsEvent", 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()), ( "height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "length_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=7, null=True ), ), ( "speed_mph", models.DecimalField( blank=True, decimal_places=2, max_digits=5, null=True ), ), ("inversions", models.PositiveIntegerField(default=0)), ( "ride_time_seconds", models.PositiveIntegerField(blank=True, null=True), ), ("track_type", models.CharField(blank=True, max_length=255)), ( "track_material", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="track_materials", choices=[ ("STEEL", "Steel"), ("WOOD", "Wood"), ("HYBRID", "Hybrid"), ], default="STEEL", domain="rides", help_text="Track construction material type", max_length=20, ), ), ( "roller_coaster_type", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, blank=True, choice_group="coaster_types", choices=[ ("SITDOWN", "Sit Down"), ("INVERTED", "Inverted"), ("FLYING", "Flying"), ("STANDUP", "Stand Up"), ("WING", "Wing"), ("DIVE", "Dive"), ("FAMILY", "Family"), ("WILD_MOUSE", "Wild Mouse"), ("SPINNING", "Spinning"), ("FOURTH_DIMENSION", "4th Dimension"), ("OTHER", "Other"), ], default="SITDOWN", domain="rides", help_text="Roller coaster type classification", max_length=20, ), ), ( "max_drop_height_ft", models.DecimalField( blank=True, decimal_places=2, max_digits=6, null=True ), ), ( "propulsion_system", apps.core.choices.fields.RichChoiceField( allow_deprecated=False, choice_group="propulsion_systems", choices=[ ("CHAIN", "Chain Lift"), ("LSM", "LSM Launch"), ("HYDRAULIC", "Hydraulic Launch"), ("GRAVITY", "Gravity"), ("OTHER", "Other"), ], default="CHAIN", domain="rides", help_text="Propulsion or lift system type", max_length=20, ), ), ("train_style", models.CharField(blank=True, max_length=255)), ("trains_count", models.PositiveIntegerField(blank=True, null=True)), ("cars_per_train", models.PositiveIntegerField(blank=True, null=True)), ("seats_per_car", models.PositiveIntegerField(blank=True, null=True)), ], options={ "abstract": False, }, ), pgtrigger.migrations.AddTrigger( model_name="company", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_companyevent" ("coasters_count", "created_at", "description", "founded_date", "id", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "updated_at", "url", "website") VALUES (NEW."coasters_count", NEW."created_at", NEW."description", NEW."founded_date", NEW."id", NEW."name", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash="fe6c1e3f09822f5e7f716cd83483cf152ec138f0", operation="INSERT", pgid="pgtrigger_insert_insert_e7194", table="rides_company", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="company", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_companyevent" ("coasters_count", "created_at", "description", "founded_date", "id", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rides_count", "roles", "slug", "updated_at", "url", "website") VALUES (NEW."coasters_count", NEW."created_at", NEW."description", NEW."founded_date", NEW."id", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rides_count", NEW."roles", NEW."slug", NEW."updated_at", NEW."url", NEW."website"); RETURN NULL;', hash="0b76cb36b7551ed3e64e674b8cfe343d4d2ec306", operation="UPDATE", pgid="pgtrigger_update_update_456a8", table="rides_company", when="AFTER", ), ), ), migrations.AddField( model_name="companyevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="companyevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.company", ), ), migrations.AddField( model_name="ride", name="designer", field=models.ForeignKey( blank=True, limit_choices_to={"roles__contains": ["DESIGNER"]}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="designed_rides", to="rides.company", ), ), migrations.AddField( model_name="ride", name="manufacturer", field=models.ForeignKey( blank=True, limit_choices_to={"roles__contains": ["MANUFACTURER"]}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="manufactured_rides", to="rides.company", ), ), migrations.AddField( model_name="ride", name="park", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="rides", to="parks.park", ), ), migrations.AddField( model_name="ride", name="park_area", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="rides", to="parks.parkarea", ), ), migrations.AddField( model_name="rankingsnapshot", name="ride", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="ranking_history", to="rides.ride", ), ), migrations.AddField( model_name="rideevent", name="designer", field=models.ForeignKey( blank=True, db_constraint=False, limit_choices_to={"roles__contains": ["DESIGNER"]}, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.company", ), ), migrations.AddField( model_name="rideevent", name="manufacturer", field=models.ForeignKey( blank=True, db_constraint=False, limit_choices_to={"roles__contains": ["MANUFACTURER"]}, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.company", ), ), migrations.AddField( model_name="rideevent", name="park", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="parks.park", ), ), migrations.AddField( model_name="rideevent", name="park_area", field=models.ForeignKey( blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="parks.parkarea", ), ), migrations.AddField( model_name="rideevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="rideevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ride", ), ), migrations.AddField( model_name="ridelocation", name="ride", field=models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, related_name="ride_location", to="rides.ride", ), ), migrations.AddField( model_name="ridelocationevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridelocationevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridelocation", ), ), migrations.AddField( model_name="ridelocationevent", name="ride", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridemodel", name="manufacturer", field=models.ForeignKey( blank=True, help_text="Primary manufacturer of this ride model", limit_choices_to={"roles__contains": ["MANUFACTURER"]}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="ride_models", to="rides.company", ), ), migrations.AddField( model_name="rideevent", name="ride_model", field=models.ForeignKey( blank=True, db_constraint=False, help_text="The specific model/type of this ride", null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridemodel", ), ), migrations.AddField( model_name="ride", name="ride_model", field=models.ForeignKey( blank=True, help_text="The specific model/type of this ride", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="rides", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodelevent", name="manufacturer", field=models.ForeignKey( blank=True, db_constraint=False, help_text="Primary manufacturer of this ride model", limit_choices_to={"roles__contains": ["MANUFACTURER"]}, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.company", ), ), migrations.AddField( model_name="ridemodelevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridemodelevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodelphoto", name="image", field=models.ForeignKey( help_text="Photo of the ride model stored on Cloudflare Images", on_delete=django.db.models.deletion.CASCADE, to="django_cloudflareimages_toolkit.cloudflareimage", ), ), migrations.AddField( model_name="ridemodelphoto", name="ride_model", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="photos", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodelevent", name="primary_image", field=models.ForeignKey( blank=True, db_constraint=False, help_text="Primary promotional image for this ride model", null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridemodelphoto", ), ), migrations.AddField( model_name="ridemodel", name="primary_image", field=models.ForeignKey( blank=True, help_text="Primary promotional image for this ride model", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="ride_models_as_primary", to="rides.ridemodelphoto", ), ), migrations.AddField( model_name="ridemodelphotoevent", name="image", field=models.ForeignKey( db_constraint=False, help_text="Photo of the ride model stored on Cloudflare Images", on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="django_cloudflareimages_toolkit.cloudflareimage", ), ), migrations.AddField( model_name="ridemodelphotoevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridemodelphotoevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridemodelphoto", ), ), migrations.AddField( model_name="ridemodelphotoevent", name="ride_model", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodeltechnicalspec", name="ride_model", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="technical_specs", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodeltechnicalspecevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridemodeltechnicalspecevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridemodeltechnicalspec", ), ), migrations.AddField( model_name="ridemodeltechnicalspecevent", name="ride_model", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodelvariant", name="ride_model", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="variants", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridemodelvariantevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridemodelvariantevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridemodelvariant", ), ), migrations.AddField( model_name="ridemodelvariantevent", name="ride_model", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridemodel", ), ), migrations.AddField( model_name="ridepaircomparison", name="ride_a", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="comparisons_as_a", to="rides.ride", ), ), migrations.AddField( model_name="ridepaircomparison", name="ride_b", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="comparisons_as_b", to="rides.ride", ), ), migrations.AddField( model_name="ridepaircomparisonevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridepaircomparisonevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridepaircomparison", ), ), migrations.AddField( model_name="ridepaircomparisonevent", name="ride_a", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridepaircomparisonevent", name="ride_b", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridephoto", name="image", field=models.ForeignKey( help_text="Ride photo stored on Cloudflare Images", on_delete=django.db.models.deletion.CASCADE, to="django_cloudflareimages_toolkit.cloudflareimage", ), ), migrations.AddField( model_name="ridephoto", name="ride", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="photos", to="rides.ride", ), ), migrations.AddField( model_name="ridephoto", name="uploaded_by", field=models.ForeignKey( null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="uploaded_ride_photos", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="rideevent", name="banner_image", field=models.ForeignKey( blank=True, db_constraint=False, help_text="Photo to use as banner image for this ride", null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridephoto", ), ), migrations.AddField( model_name="rideevent", name="card_image", field=models.ForeignKey( blank=True, db_constraint=False, help_text="Photo to use as card image for this ride", null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ridephoto", ), ), migrations.AddField( model_name="ride", name="banner_image", field=models.ForeignKey( blank=True, help_text="Photo to use as banner image for this ride", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="rides_using_as_banner", to="rides.ridephoto", ), ), migrations.AddField( model_name="ride", name="card_image", field=models.ForeignKey( blank=True, help_text="Photo to use as card image for this ride", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="rides_using_as_card", to="rides.ridephoto", ), ), migrations.AddField( model_name="ridephotoevent", name="image", field=models.ForeignKey( db_constraint=False, help_text="Ride photo stored on Cloudflare Images", on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="django_cloudflareimages_toolkit.cloudflareimage", ), ), migrations.AddField( model_name="ridephotoevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridephotoevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridephoto", ), ), migrations.AddField( model_name="ridephotoevent", name="ride", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridephotoevent", name="uploaded_by", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="rideranking", name="ride", field=models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, related_name="ranking", to="rides.ride", ), ), migrations.AddField( model_name="riderankingevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="riderankingevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.rideranking", ), ), migrations.AddField( model_name="riderankingevent", name="ride", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridereview", name="moderated_by", field=models.ForeignKey( blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="moderated_ride_reviews", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="ridereview", name="ride", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="reviews", to="rides.ride", ), ), migrations.AddField( model_name="ridereview", name="user", field=models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="ride_reviews", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="ridereviewevent", name="moderated_by", field=models.ForeignKey( blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="ridereviewevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="ridereviewevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.ridereview", ), ), migrations.AddField( model_name="ridereviewevent", name="ride", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddField( model_name="ridereviewevent", name="user", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to=settings.AUTH_USER_MODEL, ), ), migrations.AddField( model_name="rollercoasterstats", name="ride", field=models.OneToOneField( on_delete=django.db.models.deletion.CASCADE, related_name="coaster_stats", to="rides.ride", ), ), migrations.AddField( model_name="rollercoasterstatsevent", name="pgh_context", field=models.ForeignKey( db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", to="pghistory.context", ), ), migrations.AddField( model_name="rollercoasterstatsevent", name="pgh_obj", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="events", to="rides.rollercoasterstats", ), ), migrations.AddField( model_name="rollercoasterstatsevent", name="ride", field=models.ForeignKey( db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, related_name="+", related_query_name="+", to="rides.ride", ), ), migrations.AddIndex( model_name="rankingsnapshot", index=models.Index( fields=["snapshot_date", "rank"], name="rides_ranki_snapsho_8e2657_idx" ), ), migrations.AddIndex( model_name="rankingsnapshot", index=models.Index( fields=["ride", "-snapshot_date"], name="rides_ranki_ride_id_827bb9_idx" ), ), migrations.AlterUniqueTogether( name="rankingsnapshot", unique_together={("ride", "snapshot_date")}, ), migrations.AddIndex( model_name="ridelocation", index=models.Index( fields=["park_area"], name="rides_ridel_park_ar_26c90c_idx" ), ), pgtrigger.migrations.AddTrigger( model_name="ridelocation", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridelocationevent" ("accessibility_notes", "created_at", "entrance_notes", "id", "notes", "park_area", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "point", "ride_id", "updated_at") VALUES (NEW."accessibility_notes", NEW."created_at", NEW."entrance_notes", NEW."id", NEW."notes", NEW."park_area", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."point", NEW."ride_id", NEW."updated_at"); RETURN NULL;', hash="04c4c3aa17d4ef852d52b40d1dba4cd7372d5e29", operation="INSERT", pgid="pgtrigger_insert_insert_b66c2", table="rides_ridelocation", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridelocation", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridelocationevent" ("accessibility_notes", "created_at", "entrance_notes", "id", "notes", "park_area", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "point", "ride_id", "updated_at") VALUES (NEW."accessibility_notes", NEW."created_at", NEW."entrance_notes", NEW."id", NEW."notes", NEW."park_area", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."point", NEW."ride_id", NEW."updated_at"); RETURN NULL;', hash="7073b4517d00b884b2f3fddf89caeefaa64058ad", operation="UPDATE", pgid="pgtrigger_update_update_402ba", table="rides_ridelocation", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridemodelphoto", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridemodelphotoevent" ("alt_text", "caption", "copyright_info", "created_at", "id", "image_id", "is_primary", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "photo_type", "photographer", "ride_model_id", "source", "updated_at") VALUES (NEW."alt_text", NEW."caption", NEW."copyright_info", NEW."created_at", NEW."id", NEW."image_id", NEW."is_primary", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."photo_type", NEW."photographer", NEW."ride_model_id", NEW."source", NEW."updated_at"); RETURN NULL;', hash="fa289c31e25da0c08740d9e9c4072f3e4df81c42", operation="INSERT", pgid="pgtrigger_insert_insert_c5e58", table="rides_ridemodelphoto", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridemodelphoto", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridemodelphotoevent" ("alt_text", "caption", "copyright_info", "created_at", "id", "image_id", "is_primary", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "photo_type", "photographer", "ride_model_id", "source", "updated_at") VALUES (NEW."alt_text", NEW."caption", NEW."copyright_info", NEW."created_at", NEW."id", NEW."image_id", NEW."is_primary", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."photo_type", NEW."photographer", NEW."ride_model_id", NEW."source", NEW."updated_at"); RETURN NULL;', hash="1ead1d3fd3dd553f585ae76aa6f3215314322ff4", operation="UPDATE", pgid="pgtrigger_update_update_3afcd", table="rides_ridemodelphoto", when="AFTER", ), ), ), migrations.AddConstraint( model_name="ridemodel", constraint=models.CheckConstraint( condition=models.Q( ("typical_height_range_min_ft__isnull", True), ("typical_height_range_max_ft__isnull", True), ( "typical_height_range_min_ft__lte", models.F("typical_height_range_max_ft"), ), _connector="OR", ), name="ride_model_height_range_logical", violation_error_message="Minimum height cannot exceed maximum height", ), ), migrations.AddConstraint( model_name="ridemodel", constraint=models.CheckConstraint( condition=models.Q( ("typical_speed_range_min_mph__isnull", True), ("typical_speed_range_max_mph__isnull", True), ( "typical_speed_range_min_mph__lte", models.F("typical_speed_range_max_mph"), ), _connector="OR", ), name="ride_model_speed_range_logical", violation_error_message="Minimum speed cannot exceed maximum speed", ), ), migrations.AddConstraint( model_name="ridemodel", constraint=models.CheckConstraint( condition=models.Q( ("typical_capacity_range_min__isnull", True), ("typical_capacity_range_max__isnull", True), ( "typical_capacity_range_min__lte", models.F("typical_capacity_range_max"), ), _connector="OR", ), name="ride_model_capacity_range_logical", violation_error_message="Minimum capacity cannot exceed maximum capacity", ), ), migrations.AddConstraint( model_name="ridemodel", constraint=models.CheckConstraint( condition=models.Q( ("first_installation_year__isnull", True), ("last_installation_year__isnull", True), ( "first_installation_year__lte", models.F("last_installation_year"), ), _connector="OR", ), name="ride_model_installation_years_logical", violation_error_message="First installation year cannot be after last installation year", ), ), migrations.AlterUniqueTogether( name="ridemodel", unique_together={("manufacturer", "name"), ("manufacturer", "slug")}, ), pgtrigger.migrations.AddTrigger( model_name="ridemodel", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridemodelevent" ("category", "created_at", "description", "first_installation_year", "id", "is_discontinued", "last_installation_year", "manufacturer_id", "meta_description", "meta_title", "name", "notable_features", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "primary_image_id", "restraint_system", "slug", "support_structure", "target_market", "total_installations", "track_type", "train_configuration", "typical_capacity_range_max", "typical_capacity_range_min", "typical_height_range_max_ft", "typical_height_range_min_ft", "typical_speed_range_max_mph", "typical_speed_range_min_mph", "updated_at", "url") VALUES (NEW."category", NEW."created_at", NEW."description", NEW."first_installation_year", NEW."id", NEW."is_discontinued", NEW."last_installation_year", NEW."manufacturer_id", NEW."meta_description", NEW."meta_title", NEW."name", NEW."notable_features", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."primary_image_id", NEW."restraint_system", NEW."slug", NEW."support_structure", NEW."target_market", NEW."total_installations", NEW."track_type", NEW."train_configuration", NEW."typical_capacity_range_max", NEW."typical_capacity_range_min", NEW."typical_height_range_max_ft", NEW."typical_height_range_min_ft", NEW."typical_speed_range_max_mph", NEW."typical_speed_range_min_mph", NEW."updated_at", NEW."url"); RETURN NULL;', hash="9cee65f580a26ae9edc8f9fc1f3d9b25da1856c3", operation="INSERT", pgid="pgtrigger_insert_insert_0aaee", table="rides_ridemodel", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridemodel", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridemodelevent" ("category", "created_at", "description", "first_installation_year", "id", "is_discontinued", "last_installation_year", "manufacturer_id", "meta_description", "meta_title", "name", "notable_features", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "primary_image_id", "restraint_system", "slug", "support_structure", "target_market", "total_installations", "track_type", "train_configuration", "typical_capacity_range_max", "typical_capacity_range_min", "typical_height_range_max_ft", "typical_height_range_min_ft", "typical_speed_range_max_mph", "typical_speed_range_min_mph", "updated_at", "url") VALUES (NEW."category", NEW."created_at", NEW."description", NEW."first_installation_year", NEW."id", NEW."is_discontinued", NEW."last_installation_year", NEW."manufacturer_id", NEW."meta_description", NEW."meta_title", NEW."name", NEW."notable_features", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."primary_image_id", NEW."restraint_system", NEW."slug", NEW."support_structure", NEW."target_market", NEW."total_installations", NEW."track_type", NEW."train_configuration", NEW."typical_capacity_range_max", NEW."typical_capacity_range_min", NEW."typical_height_range_max_ft", NEW."typical_height_range_min_ft", NEW."typical_speed_range_max_mph", NEW."typical_speed_range_min_mph", NEW."updated_at", NEW."url"); RETURN NULL;', hash="365f87607f9f7bfee1caaabdd32b16032e04ae82", operation="UPDATE", pgid="pgtrigger_update_update_0ca1a", table="rides_ridemodel", when="AFTER", ), ), ), migrations.AlterUniqueTogether( name="ridemodeltechnicalspec", unique_together={("ride_model", "spec_category", "spec_name")}, ), pgtrigger.migrations.AddTrigger( model_name="ridemodeltechnicalspec", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridemodeltechnicalspecevent" ("created_at", "id", "notes", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_model_id", "spec_category", "spec_name", "spec_unit", "spec_value", "updated_at") VALUES (NEW."created_at", NEW."id", NEW."notes", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_model_id", NEW."spec_category", NEW."spec_name", NEW."spec_unit", NEW."spec_value", NEW."updated_at"); RETURN NULL;', hash="c69e4b67f99f3c6135baa3b1f90005dd1a28fc99", operation="INSERT", pgid="pgtrigger_insert_insert_08870", table="rides_ridemodeltechnicalspec", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridemodeltechnicalspec", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridemodeltechnicalspecevent" ("created_at", "id", "notes", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_model_id", "spec_category", "spec_name", "spec_unit", "spec_value", "updated_at") VALUES (NEW."created_at", NEW."id", NEW."notes", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_model_id", NEW."spec_category", NEW."spec_name", NEW."spec_unit", NEW."spec_value", NEW."updated_at"); RETURN NULL;', hash="9c6cdcf25f220fe155970cde66cc79e98ad44142", operation="UPDATE", pgid="pgtrigger_update_update_73620", table="rides_ridemodeltechnicalspec", when="AFTER", ), ), ), migrations.AlterUniqueTogether( name="ridemodelvariant", unique_together={("ride_model", "name")}, ), pgtrigger.migrations.AddTrigger( model_name="ridemodelvariant", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridemodelvariantevent" ("created_at", "description", "distinguishing_features", "id", "max_height_ft", "max_speed_mph", "min_height_ft", "min_speed_mph", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_model_id", "updated_at") VALUES (NEW."created_at", NEW."description", NEW."distinguishing_features", NEW."id", NEW."max_height_ft", NEW."max_speed_mph", NEW."min_height_ft", NEW."min_speed_mph", NEW."name", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_model_id", NEW."updated_at"); RETURN NULL;', hash="89d68cdcd08787e00dd8d1f25e9229eb02528f26", operation="INSERT", pgid="pgtrigger_insert_insert_1cb69", table="rides_ridemodelvariant", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridemodelvariant", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridemodelvariantevent" ("created_at", "description", "distinguishing_features", "id", "max_height_ft", "max_speed_mph", "min_height_ft", "min_speed_mph", "name", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_model_id", "updated_at") VALUES (NEW."created_at", NEW."description", NEW."distinguishing_features", NEW."id", NEW."max_height_ft", NEW."max_speed_mph", NEW."min_height_ft", NEW."min_speed_mph", NEW."name", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_model_id", NEW."updated_at"); RETURN NULL;', hash="cc7f0da0cef685e4504f8cad28af9b296ed8a2aa", operation="UPDATE", pgid="pgtrigger_update_update_f7599", table="rides_ridemodelvariant", when="AFTER", ), ), ), migrations.AddIndex( model_name="ridepaircomparison", index=models.Index( fields=["ride_a", "ride_b"], name="rides_ridep_ride_a__eb0674_idx" ), ), migrations.AddIndex( model_name="ridepaircomparison", index=models.Index( fields=["last_calculated"], name="rides_ridep_last_ca_bd9f6c_idx" ), ), migrations.AlterUniqueTogether( name="ridepaircomparison", unique_together={("ride_a", "ride_b")}, ), pgtrigger.migrations.AddTrigger( model_name="ridepaircomparison", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridepaircomparisonevent" ("id", "last_calculated", "mutual_riders_count", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_a_avg_rating", "ride_a_id", "ride_a_wins", "ride_b_avg_rating", "ride_b_id", "ride_b_wins", "ties") VALUES (NEW."id", NEW."last_calculated", NEW."mutual_riders_count", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."ride_a_avg_rating", NEW."ride_a_id", NEW."ride_a_wins", NEW."ride_b_avg_rating", NEW."ride_b_id", NEW."ride_b_wins", NEW."ties"); RETURN NULL;', hash="6a640e10fcfd58c48029ee5b84ea7f0826f50022", operation="INSERT", pgid="pgtrigger_insert_insert_9ad59", table="rides_ridepaircomparison", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridepaircomparison", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridepaircomparisonevent" ("id", "last_calculated", "mutual_riders_count", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "ride_a_avg_rating", "ride_a_id", "ride_a_wins", "ride_b_avg_rating", "ride_b_id", "ride_b_wins", "ties") VALUES (NEW."id", NEW."last_calculated", NEW."mutual_riders_count", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."ride_a_avg_rating", NEW."ride_a_id", NEW."ride_a_wins", NEW."ride_b_avg_rating", NEW."ride_b_id", NEW."ride_b_wins", NEW."ties"); RETURN NULL;', hash="a77eee0b791bada3f84f008dabd7486c66b03fa6", operation="UPDATE", pgid="pgtrigger_update_update_73b31", table="rides_ridepaircomparison", when="AFTER", ), ), ), migrations.AddIndex( model_name="ridephoto", index=models.Index( fields=["ride", "is_primary"], name="rides_ridep_ride_id_aa49f1_idx" ), ), migrations.AddIndex( model_name="ridephoto", index=models.Index( fields=["ride", "is_approved"], name="rides_ridep_ride_id_f1eddc_idx" ), ), migrations.AddIndex( model_name="ridephoto", index=models.Index( fields=["ride", "photo_type"], name="rides_ridep_ride_id_49e7ec_idx" ), ), migrations.AddIndex( model_name="ridephoto", index=models.Index( fields=["created_at"], name="rides_ridep_created_106e02_idx" ), ), migrations.AddConstraint( model_name="ridephoto", constraint=models.UniqueConstraint( condition=models.Q(("is_primary", True)), fields=("ride",), name="unique_primary_ride_photo", ), ), pgtrigger.migrations.AddTrigger( model_name="ridephoto", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridephotoevent" ("alt_text", "caption", "created_at", "date_taken", "id", "image_id", "is_approved", "is_primary", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "photo_type", "ride_id", "updated_at", "uploaded_by_id") VALUES (NEW."alt_text", NEW."caption", NEW."created_at", NEW."date_taken", NEW."id", NEW."image_id", NEW."is_approved", NEW."is_primary", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."photo_type", NEW."ride_id", NEW."updated_at", NEW."uploaded_by_id"); RETURN NULL;', hash="51487ac871d9d90c75f695f106e5f1f43fdb00c6", operation="INSERT", pgid="pgtrigger_insert_insert_0043a", table="rides_ridephoto", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridephoto", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridephotoevent" ("alt_text", "caption", "created_at", "date_taken", "id", "image_id", "is_approved", "is_primary", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "photo_type", "ride_id", "updated_at", "uploaded_by_id") VALUES (NEW."alt_text", NEW."caption", NEW."created_at", NEW."date_taken", NEW."id", NEW."image_id", NEW."is_approved", NEW."is_primary", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."photo_type", NEW."ride_id", NEW."updated_at", NEW."uploaded_by_id"); RETURN NULL;', hash="6147489f087c144f887386548cba269ffc193094", operation="UPDATE", pgid="pgtrigger_update_update_93a7e", table="rides_ridephoto", when="AFTER", ), ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("closing_date__isnull", True), ("opening_date__isnull", True), ("closing_date__gte", models.F("opening_date")), _connector="OR", ), name="ride_closing_after_opening", violation_error_message="Closing date must be after opening date", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("min_height_in__isnull", True), ("max_height_in__isnull", True), ("min_height_in__lte", models.F("max_height_in")), _connector="OR", ), name="ride_height_requirements_logical", violation_error_message="Minimum height cannot exceed maximum height", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("min_height_in__isnull", True), models.Q(("min_height_in__gte", 30), ("min_height_in__lte", 90)), _connector="OR", ), name="ride_min_height_reasonable", violation_error_message="Minimum height must be between 30 and 90 inches", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("max_height_in__isnull", True), models.Q(("max_height_in__gte", 30), ("max_height_in__lte", 90)), _connector="OR", ), name="ride_max_height_reasonable", violation_error_message="Maximum height must be between 30 and 90 inches", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("average_rating__isnull", True), models.Q(("average_rating__gte", 1), ("average_rating__lte", 10)), _connector="OR", ), name="ride_rating_range", violation_error_message="Average rating must be between 1 and 10", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("capacity_per_hour__isnull", True), ("capacity_per_hour__gt", 0), _connector="OR", ), name="ride_capacity_positive", violation_error_message="Hourly capacity must be positive", ), ), migrations.AddConstraint( model_name="ride", constraint=models.CheckConstraint( condition=models.Q( ("ride_duration_seconds__isnull", True), ("ride_duration_seconds__gt", 0), _connector="OR", ), name="ride_duration_positive", violation_error_message="Ride duration must be positive", ), ), migrations.AlterUniqueTogether( name="ride", unique_together={("park", "slug")}, ), pgtrigger.migrations.AddTrigger( model_name="ride", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_rideevent" ("average_rating", "banner_image_id", "capacity_per_hour", "card_image_id", "category", "closing_date", "created_at", "description", "designer_id", "id", "manufacturer_id", "max_height_in", "min_height_in", "name", "opening_date", "opening_year", "park_area_id", "park_id", "park_url", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "post_closing_status", "ride_duration_seconds", "ride_model_id", "search_text", "slug", "status", "status_since", "updated_at", "url") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."capacity_per_hour", NEW."card_image_id", NEW."category", NEW."closing_date", NEW."created_at", NEW."description", NEW."designer_id", NEW."id", NEW."manufacturer_id", NEW."max_height_in", NEW."min_height_in", NEW."name", NEW."opening_date", NEW."opening_year", NEW."park_area_id", NEW."park_id", NEW."park_url", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."post_closing_status", NEW."ride_duration_seconds", NEW."ride_model_id", NEW."search_text", NEW."slug", NEW."status", NEW."status_since", NEW."updated_at", NEW."url"); RETURN NULL;', hash="64e055c574495c0f09b3cbfb12442d4e4113e4f2", operation="INSERT", pgid="pgtrigger_insert_insert_52074", table="rides_ride", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ride", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_rideevent" ("average_rating", "banner_image_id", "capacity_per_hour", "card_image_id", "category", "closing_date", "created_at", "description", "designer_id", "id", "manufacturer_id", "max_height_in", "min_height_in", "name", "opening_date", "opening_year", "park_area_id", "park_id", "park_url", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "post_closing_status", "ride_duration_seconds", "ride_model_id", "search_text", "slug", "status", "status_since", "updated_at", "url") VALUES (NEW."average_rating", NEW."banner_image_id", NEW."capacity_per_hour", NEW."card_image_id", NEW."category", NEW."closing_date", NEW."created_at", NEW."description", NEW."designer_id", NEW."id", NEW."manufacturer_id", NEW."max_height_in", NEW."min_height_in", NEW."name", NEW."opening_date", NEW."opening_year", NEW."park_area_id", NEW."park_id", NEW."park_url", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."post_closing_status", NEW."ride_duration_seconds", NEW."ride_model_id", NEW."search_text", NEW."slug", NEW."status", NEW."status_since", NEW."updated_at", NEW."url"); RETURN NULL;', hash="6476c8dd4bbb0e2ae42ca2daa5c691b87f9119e9", operation="UPDATE", pgid="pgtrigger_update_update_4917a", table="rides_ride", when="AFTER", ), ), ), migrations.AddIndex( model_name="rideranking", index=models.Index(fields=["rank"], name="rides_rider_rank_ea4706_idx"), ), migrations.AddIndex( model_name="rideranking", index=models.Index( fields=["winning_percentage", "-mutual_riders_count"], name="rides_rider_winning_d9b3e8_idx", ), ), migrations.AddIndex( model_name="rideranking", index=models.Index( fields=["ride", "last_calculated"], name="rides_rider_ride_id_ece73d_idx", ), ), migrations.AddConstraint( model_name="rideranking", constraint=models.CheckConstraint( condition=models.Q( ("winning_percentage__gte", 0), ("winning_percentage__lte", 1) ), name="rideranking_winning_percentage_range", violation_error_message="Winning percentage must be between 0 and 1", ), ), migrations.AddConstraint( model_name="rideranking", constraint=models.CheckConstraint( condition=models.Q( ("average_rating__isnull", True), models.Q(("average_rating__gte", 1), ("average_rating__lte", 10)), _connector="OR", ), name="rideranking_average_rating_range", violation_error_message="Average rating must be between 1 and 10", ), ), pgtrigger.migrations.AddTrigger( model_name="rideranking", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_riderankingevent" ("average_rating", "calculation_version", "comparison_count", "id", "last_calculated", "losses", "mutual_riders_count", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rank", "ride_id", "ties", "winning_percentage", "wins") VALUES (NEW."average_rating", NEW."calculation_version", NEW."comparison_count", NEW."id", NEW."last_calculated", NEW."losses", NEW."mutual_riders_count", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rank", NEW."ride_id", NEW."ties", NEW."winning_percentage", NEW."wins"); RETURN NULL;', hash="c5f9dced5824a55e6f36e476eb382ed770aa5716", operation="INSERT", pgid="pgtrigger_insert_insert_01af3", table="rides_rideranking", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="rideranking", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_riderankingevent" ("average_rating", "calculation_version", "comparison_count", "id", "last_calculated", "losses", "mutual_riders_count", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rank", "ride_id", "ties", "winning_percentage", "wins") VALUES (NEW."average_rating", NEW."calculation_version", NEW."comparison_count", NEW."id", NEW."last_calculated", NEW."losses", NEW."mutual_riders_count", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rank", NEW."ride_id", NEW."ties", NEW."winning_percentage", NEW."wins"); RETURN NULL;', hash="363e44ce3c87e8b66406d63d6f1b26ad604c79d2", operation="UPDATE", pgid="pgtrigger_update_update_c3f27", table="rides_rideranking", when="AFTER", ), ), ), migrations.AddConstraint( model_name="ridereview", constraint=models.CheckConstraint( condition=models.Q(("rating__gte", 1), ("rating__lte", 10)), name="ride_review_rating_range", violation_error_message="Rating must be between 1 and 10", ), ), migrations.AddConstraint( model_name="ridereview", constraint=models.CheckConstraint( condition=models.Q( ("visit_date__lte", django.db.models.functions.datetime.Now()) ), name="ride_review_visit_date_not_future", violation_error_message="Visit date cannot be in the future", ), ), migrations.AddConstraint( model_name="ridereview", constraint=models.CheckConstraint( condition=models.Q( models.Q( ("moderated_at__isnull", True), ("moderated_by__isnull", True) ), models.Q( ("moderated_at__isnull", False), ("moderated_by__isnull", False) ), _connector="OR", ), name="ride_review_moderation_consistency", violation_error_message="Moderated reviews must have both moderator and moderation timestamp", ), ), migrations.AlterUniqueTogether( name="ridereview", unique_together={("ride", "user")}, ), pgtrigger.migrations.AddTrigger( model_name="ridereview", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_ridereviewevent" ("content", "created_at", "id", "is_published", "moderated_at", "moderated_by_id", "moderation_notes", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rating", "ride_id", "title", "updated_at", "user_id", "visit_date") VALUES (NEW."content", NEW."created_at", NEW."id", NEW."is_published", NEW."moderated_at", NEW."moderated_by_id", NEW."moderation_notes", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."rating", NEW."ride_id", NEW."title", NEW."updated_at", NEW."user_id", NEW."visit_date"); RETURN NULL;', hash="0d6021859fef528429d7d6028439c08de6040e52", operation="INSERT", pgid="pgtrigger_insert_insert_33237", table="rides_ridereview", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="ridereview", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_ridereviewevent" ("content", "created_at", "id", "is_published", "moderated_at", "moderated_by_id", "moderation_notes", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "rating", "ride_id", "title", "updated_at", "user_id", "visit_date") VALUES (NEW."content", NEW."created_at", NEW."id", NEW."is_published", NEW."moderated_at", NEW."moderated_by_id", NEW."moderation_notes", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."rating", NEW."ride_id", NEW."title", NEW."updated_at", NEW."user_id", NEW."visit_date"); RETURN NULL;', hash="b0acd6ed16f909a42f9bedd975c7f385d0868d32", operation="UPDATE", pgid="pgtrigger_update_update_90298", table="rides_ridereview", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="rollercoasterstats", trigger=pgtrigger.compiler.Trigger( name="insert_insert", sql=pgtrigger.compiler.UpsertTriggerSql( func='INSERT INTO "rides_rollercoasterstatsevent" ("cars_per_train", "height_ft", "id", "inversions", "length_ft", "max_drop_height_ft", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "propulsion_system", "ride_id", "ride_time_seconds", "roller_coaster_type", "seats_per_car", "speed_mph", "track_material", "track_type", "train_style", "trains_count") VALUES (NEW."cars_per_train", NEW."height_ft", NEW."id", NEW."inversions", NEW."length_ft", NEW."max_drop_height_ft", _pgh_attach_context(), NOW(), \'insert\', NEW."id", NEW."propulsion_system", NEW."ride_id", NEW."ride_time_seconds", NEW."roller_coaster_type", NEW."seats_per_car", NEW."speed_mph", NEW."track_material", NEW."track_type", NEW."train_style", NEW."trains_count"); RETURN NULL;', hash="89e2bb56c0befa025a9961f8df34a8a02c09f188", operation="INSERT", pgid="pgtrigger_insert_insert_96f8b", table="rides_rollercoasterstats", when="AFTER", ), ), ), pgtrigger.migrations.AddTrigger( model_name="rollercoasterstats", trigger=pgtrigger.compiler.Trigger( name="update_update", sql=pgtrigger.compiler.UpsertTriggerSql( condition="WHEN (OLD.* IS DISTINCT FROM NEW.*)", func='INSERT INTO "rides_rollercoasterstatsevent" ("cars_per_train", "height_ft", "id", "inversions", "length_ft", "max_drop_height_ft", "pgh_context_id", "pgh_created_at", "pgh_label", "pgh_obj_id", "propulsion_system", "ride_id", "ride_time_seconds", "roller_coaster_type", "seats_per_car", "speed_mph", "track_material", "track_type", "train_style", "trains_count") VALUES (NEW."cars_per_train", NEW."height_ft", NEW."id", NEW."inversions", NEW."length_ft", NEW."max_drop_height_ft", _pgh_attach_context(), NOW(), \'update\', NEW."id", NEW."propulsion_system", NEW."ride_id", NEW."ride_time_seconds", NEW."roller_coaster_type", NEW."seats_per_car", NEW."speed_mph", NEW."track_material", NEW."track_type", NEW."train_style", NEW."trains_count"); RETURN NULL;', hash="047cc99ae3282202b6dc43c8dbe07690076d5068", operation="UPDATE", pgid="pgtrigger_update_update_24e8a", table="rides_rollercoasterstats", when="AFTER", ), ), ), ]