trainvel/sncfgtfs/migrations/0001_initial.py

582 lines
20 KiB
Python
Raw Normal View History

2024-01-27 14:18:33 +00:00
# Generated by Django 5.0.1 on 2024-01-27 14:08
2024-01-26 00:31:14 +00:00
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Agency",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Agency ID",
),
),
(
2024-01-27 09:43:59 +00:00
"name",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255, unique=True, verbose_name="Agency name"
),
),
2024-01-27 09:43:59 +00:00
("url", models.URLField(verbose_name="Agency URL")),
2024-01-26 00:31:14 +00:00
(
2024-01-27 09:43:59 +00:00
"timezone",
2024-01-26 00:31:14 +00:00
models.CharField(max_length=255, verbose_name="Agency timezone"),
),
(
2024-01-27 09:43:59 +00:00
"lang",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Agency language"
),
),
2024-01-27 09:43:59 +00:00
(
"phone",
models.CharField(
blank=True, max_length=255, verbose_name="Agency phone"
),
),
(
"email",
models.EmailField(
blank=True, max_length=254, verbose_name="Agency email"
),
),
2024-01-26 00:31:14 +00:00
],
options={
"verbose_name": "Agency",
"verbose_name_plural": "Agencies",
2024-01-27 14:18:33 +00:00
"ordering": ("name",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="Calendar",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Service ID",
),
),
("monday", models.BooleanField(verbose_name="Monday")),
("tuesday", models.BooleanField(verbose_name="Tuesday")),
("wednesday", models.BooleanField(verbose_name="Wednesday")),
("thursday", models.BooleanField(verbose_name="Thursday")),
("friday", models.BooleanField(verbose_name="Friday")),
("saturday", models.BooleanField(verbose_name="Saturday")),
("sunday", models.BooleanField(verbose_name="Sunday")),
("start_date", models.DateField(verbose_name="Start date")),
("end_date", models.DateField(verbose_name="End date")),
2024-01-27 09:43:59 +00:00
(
"transport_type",
models.CharField(
choices=[
("TGV", "TGV"),
("TER", "TER"),
("IC", "Intercités"),
("TN", "Transilien"),
],
max_length=255,
verbose_name="Transport type",
),
),
2024-01-26 00:31:14 +00:00
],
options={
"verbose_name": "Calendar",
"verbose_name_plural": "Calendars",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="FeedInfo",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
2024-01-26 00:31:14 +00:00
),
),
(
2024-01-27 14:18:33 +00:00
"publisher_name",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255, verbose_name="Feed publisher name"
),
),
2024-01-27 14:18:33 +00:00
("publisher_url", models.URLField(verbose_name="Feed publisher URL")),
2024-01-26 00:31:14 +00:00
(
2024-01-27 14:18:33 +00:00
"lang",
2024-01-26 00:31:14 +00:00
models.CharField(max_length=255, verbose_name="Feed language"),
),
2024-01-27 14:18:33 +00:00
("start_date", models.DateField(verbose_name="Feed start date")),
("end_date", models.DateField(verbose_name="Feed end date")),
2024-01-26 00:31:14 +00:00
(
2024-01-27 14:18:33 +00:00
"version",
2024-01-26 00:31:14 +00:00
models.CharField(max_length=255, verbose_name="Feed version"),
),
],
options={
"verbose_name": "Feed info",
"verbose_name_plural": "Feed infos",
2024-01-27 14:18:33 +00:00
"ordering": ("publisher_name",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="CalendarDate",
fields=[
(
"id",
2024-01-27 09:43:59 +00:00
models.CharField(
max_length=255,
2024-01-26 00:31:14 +00:00
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("date", models.DateField(verbose_name="Date")),
(
2024-01-27 09:43:59 +00:00
"exception_type",
models.IntegerField(
choices=[(1, "Added"), (2, "Removed")],
verbose_name="Exception type",
),
),
(
"transport_type",
models.CharField(
choices=[
("TGV", "TGV"),
("TER", "TER"),
("IC", "Intercités"),
("TN", "Transilien"),
],
max_length=255,
verbose_name="Transport type",
),
),
(
"service",
2024-01-26 00:31:14 +00:00
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-01-27 09:43:59 +00:00
related_name="dates",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.calendar",
2024-01-27 09:43:59 +00:00
verbose_name="Service",
2024-01-26 00:31:14 +00:00
),
),
],
options={
"verbose_name": "Calendar date",
"verbose_name_plural": "Calendar dates",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="Route",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
2024-01-27 09:43:59 +00:00
verbose_name="ID",
2024-01-26 00:31:14 +00:00
),
),
(
2024-01-27 09:43:59 +00:00
"short_name",
2024-01-26 00:31:14 +00:00
models.CharField(max_length=255, verbose_name="Route short name"),
),
(
2024-01-27 09:43:59 +00:00
"long_name",
2024-01-26 00:31:14 +00:00
models.CharField(max_length=255, verbose_name="Route long name"),
),
(
2024-01-27 09:43:59 +00:00
"desc",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Route description"
),
),
(
2024-01-27 09:43:59 +00:00
"type",
2024-01-26 00:31:14 +00:00
models.IntegerField(
choices=[
(0, "Tram"),
(1, "Metro"),
(2, "Rail"),
(3, "Bus"),
(4, "Ferry"),
(5, "Cable car"),
(6, "Gondola"),
(7, "Funicular"),
],
verbose_name="Route type",
),
),
2024-01-27 09:43:59 +00:00
("url", models.URLField(blank=True, verbose_name="Route URL")),
2024-01-26 00:31:14 +00:00
(
2024-01-27 09:43:59 +00:00
"color",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Route color"
),
),
(
2024-01-27 09:43:59 +00:00
"text_color",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Route text color"
),
),
(
"agency",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-01-27 09:43:59 +00:00
related_name="routes",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.agency",
verbose_name="Agency ID",
),
),
],
options={
"verbose_name": "Route",
"verbose_name_plural": "Routes",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="Stop",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Stop ID",
),
),
(
2024-01-27 09:43:59 +00:00
"code",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Stop code"
),
),
2024-01-27 09:43:59 +00:00
("name", models.CharField(max_length=255, verbose_name="Stop name")),
2024-01-26 00:31:14 +00:00
(
2024-01-27 09:43:59 +00:00
"desc",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Stop description"
),
),
2024-01-27 09:43:59 +00:00
("lon", models.FloatField(verbose_name="Stop longitude")),
("lat", models.FloatField(verbose_name="Stop latitude")),
2024-01-26 00:31:14 +00:00
("zone_id", models.CharField(max_length=255, verbose_name="Zone ID")),
2024-01-27 09:43:59 +00:00
("url", models.URLField(blank=True, verbose_name="Stop URL")),
2024-01-26 00:31:14 +00:00
(
"location_type",
models.IntegerField(
blank=True,
choices=[
(0, "Stop/platform"),
(1, "Station"),
(2, "Entrance/exit"),
(3, "Generic node"),
(4, "Boarding area"),
],
default=0,
verbose_name="Location type",
),
),
(
2024-01-27 09:43:59 +00:00
"timezone",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Stop timezone"
),
),
(
"level_id",
models.CharField(
blank=True, max_length=255, verbose_name="Level ID"
),
),
(
"wheelchair_boarding",
models.IntegerField(
blank=True,
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
verbose_name="Wheelchair boarding",
),
),
(
"platform_code",
2024-01-27 09:43:59 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Platform code"
),
2024-01-26 00:31:14 +00:00
),
(
"parent_station",
models.ForeignKey(
blank=True,
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
on_delete=django.db.models.deletion.PROTECT,
2024-01-27 09:43:59 +00:00
related_name="children",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.stop",
verbose_name="Parent station",
),
),
],
options={
"verbose_name": "Stop",
"verbose_name_plural": "Stops",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="Transfer",
fields=[
(
"id",
2024-01-27 09:43:59 +00:00
models.CharField(
max_length=255,
2024-01-26 00:31:14 +00:00
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
2024-01-26 20:16:26 +00:00
(
"transfer_type",
models.IntegerField(
choices=[
(0, "Recommended"),
(1, "Timed"),
(2, "Minimum time"),
(3, "Not possible"),
],
default=0,
verbose_name="Transfer type",
),
),
2024-01-26 00:31:14 +00:00
(
"min_transfer_time",
models.IntegerField(
blank=True, verbose_name="Minimum transfer time"
),
),
(
"from_stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transfers_from",
to="sncfgtfs.stop",
2024-01-26 20:16:26 +00:00
verbose_name="From stop",
2024-01-26 00:31:14 +00:00
),
),
(
"to_stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="transfers_to",
to="sncfgtfs.stop",
2024-01-26 20:16:26 +00:00
verbose_name="To stop",
2024-01-26 00:31:14 +00:00
),
),
],
options={
"verbose_name": "Transfer",
"verbose_name_plural": "Transfers",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="Trip",
fields=[
(
2024-01-27 09:43:59 +00:00
"id",
2024-01-26 00:31:14 +00:00
models.CharField(
max_length=255,
primary_key=True,
serialize=False,
verbose_name="Trip ID",
),
),
(
2024-01-27 09:43:59 +00:00
"headsign",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Trip headsign"
),
),
(
2024-01-27 09:43:59 +00:00
"short_name",
2024-01-26 00:31:14 +00:00
models.CharField(
blank=True, max_length=255, verbose_name="Trip short name"
),
),
(
"direction_id",
models.IntegerField(
choices=[(0, "Outbound"), (1, "Inbound")],
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
verbose_name="Direction",
),
),
(
"block_id",
models.CharField(
blank=True, max_length=255, verbose_name="Block ID"
),
),
(
"shape_id",
models.CharField(
blank=True, max_length=255, verbose_name="Shape ID"
),
),
(
"wheelchair_accessible",
models.IntegerField(
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
verbose_name="Wheelchair accessible",
),
),
(
"bikes_allowed",
models.IntegerField(
choices=[
(0, "No information"),
(1, "Possible"),
(2, "Not possible"),
],
default=0,
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
verbose_name="Bikes allowed",
),
),
(
"route",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-01-27 09:43:59 +00:00
related_name="trips",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.route",
2024-01-27 09:43:59 +00:00
verbose_name="Route",
),
),
(
"service",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="trips",
to="sncfgtfs.calendar",
verbose_name="Service",
2024-01-26 00:31:14 +00:00
),
),
],
options={
"verbose_name": "Trip",
"verbose_name_plural": "Trips",
2024-01-27 14:18:33 +00:00
"ordering": ("id",),
2024-01-26 00:31:14 +00:00
},
),
migrations.CreateModel(
name="StopTime",
fields=[
(
"id",
2024-01-27 09:43:59 +00:00
models.CharField(
max_length=255,
2024-01-26 00:31:14 +00:00
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
2024-01-27 10:43:01 +00:00
("arrival_time", models.DurationField(verbose_name="Arrival time")),
("departure_time", models.DurationField(verbose_name="Departure time")),
2024-01-26 00:31:14 +00:00
("stop_sequence", models.IntegerField(verbose_name="Stop sequence")),
(
"stop_headsign",
models.CharField(
blank=True, max_length=255, verbose_name="Stop headsign"
),
),
(
"pickup_type",
models.IntegerField(
choices=[
(0, "Regular"),
(1, "None"),
(2, "Must phone agency"),
(3, "Must coordinate with driver"),
],
default=0,
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
verbose_name="Pickup type",
),
),
(
"drop_off_type",
models.IntegerField(
choices=[
(0, "Regular"),
(1, "None"),
(2, "Must phone agency"),
(3, "Must coordinate with driver"),
],
default=0,
2024-01-27 09:43:59 +00:00
null=True,
2024-01-26 00:31:14 +00:00
verbose_name="Drop off type",
),
),
(
"timepoint",
models.BooleanField(
2024-01-27 09:43:59 +00:00
default=True, null=True, verbose_name="Timepoint"
2024-01-26 00:31:14 +00:00
),
),
(
"stop",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-01-27 09:43:59 +00:00
related_name="stop_times",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.stop",
verbose_name="Stop ID",
),
),
(
2024-01-27 09:43:59 +00:00
"trip",
2024-01-26 00:31:14 +00:00
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-01-27 09:43:59 +00:00
related_name="stop_times",
2024-01-26 00:31:14 +00:00
to="sncfgtfs.trip",
2024-01-27 09:43:59 +00:00
verbose_name="Trip",
2024-01-26 00:31:14 +00:00
),
),
],
options={
"verbose_name": "Stop time",
"verbose_name_plural": "Stop times",
},
),
]