trainvel/sncfgtfs/migrations/0002_alter_trip_options_tri...

109 lines
4.0 KiB
Python
Raw Normal View History

2024-02-06 07:01:56 +00:00
# Generated by Django 5.0.1 on 2024-02-06 06:59
2024-02-04 21:20:09 +00:00
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("sncfgtfs", "0001_initial"),
]
operations = [
migrations.AlterModelOptions(
name="trip",
options={"verbose_name": "Trip", "verbose_name_plural": "Trips"},
),
migrations.CreateModel(
name="TripUpdate",
fields=[
(
"trip",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
related_name="update",
serialize=False,
to="sncfgtfs.trip",
verbose_name="Trip",
),
),
("start_date", models.DateField(verbose_name="Start date")),
("start_time", models.TimeField(verbose_name="Start time")),
(
"schedule_relationship",
models.IntegerField(
choices=[
(0, "Scheduled"),
2024-02-06 07:01:56 +00:00
(1, "Added"),
(2, "Unscheduled"),
(3, "Canceled"),
(5, "Replacement"),
(6, "Duplicated"),
(7, "Deleted"),
2024-02-04 21:20:09 +00:00
],
default=0,
verbose_name="Schedule relationship",
),
),
],
options={
"verbose_name": "Trip update",
"verbose_name_plural": "Trip updates",
"ordering": ("start_date", "trip"),
"unique_together": {("trip", "start_date", "start_time")},
},
),
migrations.CreateModel(
name="StopTimeUpdate",
fields=[
(
"stop_time",
models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE,
primary_key=True,
related_name="update",
serialize=False,
to="sncfgtfs.stoptime",
verbose_name="Stop time",
),
),
("arrival_delay", models.DurationField(verbose_name="Arrival delay")),
("arrival_time", models.DateTimeField(verbose_name="Arrival time")),
(
"departure_delay",
models.DurationField(verbose_name="Departure delay"),
),
("departure_time", models.DateTimeField(verbose_name="Departure time")),
(
"schedule_relationship",
models.IntegerField(
choices=[
(0, "Scheduled"),
(1, "Skipped"),
(2, "No data"),
(3, "Unscheduled"),
],
default=0,
verbose_name="Schedule relationship",
),
),
(
"trip_update",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="stop_time_updates",
to="sncfgtfs.tripupdate",
verbose_name="Trip update",
),
),
],
options={
"verbose_name": "Stop time update",
"verbose_name_plural": "Stop time updates",
"ordering": ("trip_update", "stop_time"),
"unique_together": {("trip_update", "stop_time")},
},
),
]