mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 07:31:07 -05:00
- Updated migration files to remove references to the old `companies` app and replace them with new app dependencies (`operators` and `manufacturers`). - Fixed foreign key references in migration files to point to the correct models in the new apps. - Updated import statements in management commands and test files to reflect the new app structure. - Completed a thorough validation of the migration system to ensure full functionality and operational status.
127 lines
4.9 KiB
Python
127 lines
4.9 KiB
Python
# Generated by Django 5.1.4 on 2025-02-10 09:31
|
|
|
|
import django.db.models.deletion
|
|
from django.db import migrations, models
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = [
|
|
("manufacturers", "0001_initial"),
|
|
("designers", "0001_initial"),
|
|
("parks", "0001_initial"), # Changed to depend on initial parks migration
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Ride",
|
|
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)),
|
|
(
|
|
"category",
|
|
models.CharField(
|
|
blank=True,
|
|
choices=[
|
|
("", "Select ride type"),
|
|
("RC", "Roller Coaster"),
|
|
("DR", "Dark Ride"),
|
|
("FR", "Flat Ride"),
|
|
("WR", "Water Ride"),
|
|
("TR", "Transport"),
|
|
("OT", "Other"),
|
|
],
|
|
default="",
|
|
max_length=2,
|
|
),
|
|
),
|
|
(
|
|
"status",
|
|
models.CharField(
|
|
choices=[
|
|
("OPERATING", "Operating"),
|
|
("SBNO", "Standing But Not Operating"),
|
|
("CLOSING", "Closing"),
|
|
("CLOSED_PERM", "Permanently Closed"),
|
|
("UNDER_CONSTRUCTION", "Under Construction"),
|
|
("DEMOLISHED", "Demolished"),
|
|
("RELOCATED", "Relocated"),
|
|
],
|
|
default="OPERATING",
|
|
max_length=20,
|
|
),
|
|
),
|
|
(
|
|
"post_closing_status",
|
|
models.CharField(
|
|
blank=True,
|
|
choices=[
|
|
("SBNO", "Standing But Not Operating"),
|
|
("CLOSED_PERM", "Permanently Closed"),
|
|
],
|
|
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
|
|
),
|
|
),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
(
|
|
"designer",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="rides",
|
|
to="designers.designer",
|
|
),
|
|
),
|
|
(
|
|
"manufacturer",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
to="manufacturers.manufacturer",
|
|
),
|
|
),
|
|
(
|
|
"park",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="rides",
|
|
to="parks.park",
|
|
),
|
|
),
|
|
(
|
|
"park_area",
|
|
models.ForeignKey(
|
|
blank=True,
|
|
null=True,
|
|
on_delete=django.db.models.deletion.SET_NULL,
|
|
related_name="rides",
|
|
to="parks.parkarea",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
]
|