mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 13:51:09 -05:00
64 lines
3.5 KiB
Python
64 lines
3.5 KiB
Python
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
('companies', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Park',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255)),
|
|
('slug', models.SlugField(max_length=255, unique=True)),
|
|
('description', models.TextField(blank=True)),
|
|
('status', models.CharField(choices=[('OPERATING', 'Operating'), ('CLOSED_TEMP', 'Temporarily Closed'), ('CLOSED_PERM', 'Permanently Closed'), ('UNDER_CONSTRUCTION', 'Under Construction'), ('DEMOLISHED', 'Demolished'), ('RELOCATED', 'Relocated')], default='OPERATING', max_length=20)),
|
|
('opening_date', models.DateField(blank=True, null=True)),
|
|
('closing_date', models.DateField(blank=True, null=True)),
|
|
('operating_season', models.CharField(blank=True, max_length=255)),
|
|
('size_acres', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
|
|
('website', models.URLField(blank=True)),
|
|
('average_rating', models.DecimalField(blank=True, decimal_places=2, max_digits=3, null=True)),
|
|
('total_rides', models.IntegerField(blank=True, null=True)),
|
|
('total_roller_coasters', models.IntegerField(blank=True, null=True)),
|
|
('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
|
|
('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=9, null=True)),
|
|
('street_address', models.CharField(blank=True, max_length=255)),
|
|
('city', models.CharField(blank=True, max_length=255)),
|
|
('state', models.CharField(blank=True, max_length=255)),
|
|
('country', models.CharField(blank=True, max_length=255)),
|
|
('postal_code', models.CharField(blank=True, max_length=20)),
|
|
('created_at', models.DateTimeField(auto_now_add=True, null=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='parks', to='companies.company')),
|
|
],
|
|
options={
|
|
'ordering': ['name'],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='ParkArea',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255)),
|
|
('slug', models.SlugField(max_length=255)),
|
|
('description', models.TextField(blank=True)),
|
|
('opening_date', models.DateField(blank=True, null=True)),
|
|
('closing_date', models.DateField(blank=True, null=True)),
|
|
('created_at', models.DateTimeField(auto_now_add=True, null=True)),
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
|
('park', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='areas', to='parks.park')),
|
|
],
|
|
options={
|
|
'ordering': ['name'],
|
|
'unique_together': {('park', 'slug')},
|
|
},
|
|
),
|
|
]
|