From 661cccc2da9a6c32b7b56c60313787282a9084ea Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Tue, 21 Oct 2025 15:34:24 +0200 Subject: Begin implementing --- .../20250821135143_InitialGtfsData.Designer.cs | 398 +++++++++++++++++++++ .../Migrations/20250821135143_InitialGtfsData.cs | 215 +++++++++++ .../Data/Migrations/AppDbContextModelSnapshot.cs | 395 ++++++++++++++++++++ 3 files changed, 1008 insertions(+) create mode 100644 src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.Designer.cs create mode 100644 src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.cs create mode 100644 src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/AppDbContextModelSnapshot.cs (limited to 'src/Costasdev.Busurbano.ServiceViewer/Data/Migrations') diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.Designer.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.Designer.cs new file mode 100644 index 0000000..d123034 --- /dev/null +++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.Designer.cs @@ -0,0 +1,398 @@ +// +using System; +using Costasdev.Busurbano.Database; +using Costasdev.ServiceViewer; +using Costasdev.ServiceViewer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Costasdev.Busurbano.Database.Migrations +{ + [DbContext(typeof(AppDbContext))] + [Migration("20250821135143_InitialGtfsData")] + partial class InitialGtfsData + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Agency", b => + { + b.Property("Id") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_id"); + + b.Property("Email") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_email"); + + b.Property("FareUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_fare_url"); + + b.Property("Language") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasColumnName("agency_lang"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_name"); + + b.Property("Phone") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("agency_phone"); + + b.Property("Timezone") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("agency_timezone"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_url"); + + b.HasKey("Id"); + + b.ToTable("agencies"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Calendar", b => + { + b.Property("ServiceId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("EndDate") + .HasColumnType("date") + .HasColumnName("end_date"); + + b.Property("Friday") + .HasColumnType("tinyint(1)") + .HasColumnName("friday"); + + b.Property("Monday") + .HasColumnType("tinyint(1)") + .HasColumnName("monday"); + + b.Property("Saturday") + .HasColumnType("tinyint(1)") + .HasColumnName("saturday"); + + b.Property("StartDate") + .HasColumnType("date") + .HasColumnName("start_date"); + + b.Property("Sunday") + .HasColumnType("tinyint(1)") + .HasColumnName("sunday"); + + b.Property("Thursday") + .HasColumnType("tinyint(1)") + .HasColumnName("thursday"); + + b.Property("Tuesday") + .HasColumnType("tinyint(1)") + .HasColumnName("tuesday"); + + b.Property("Wednesday") + .HasColumnType("tinyint(1)") + .HasColumnName("wednesday"); + + b.HasKey("ServiceId"); + + b.ToTable("calendar"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.CalendarDate", b => + { + b.Property("ServiceId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("Date") + .HasColumnType("date") + .HasColumnName("date"); + + b.Property("ExceptionType") + .HasColumnType("int") + .HasColumnName("exception_type"); + + b.HasKey("ServiceId", "Date"); + + b.ToTable("calendar_dates"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Route", b => + { + b.Property("Id") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_id"); + + b.Property("AgencyId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_id"); + + b.Property("Color") + .HasMaxLength(7) + .HasColumnType("varchar(7)") + .HasColumnName("route_color"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_desc"); + + b.Property("LongName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_long_name"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("route_short_name"); + + b.Property("SortOrder") + .HasColumnType("int") + .HasColumnName("route_sort_order"); + + b.Property("TextColor") + .HasMaxLength(7) + .HasColumnType("varchar(7)") + .HasColumnName("route_text_color"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("route_type"); + + b.Property("Url") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_url"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId"); + + b.ToTable("routes"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Stop", b => + { + b.Property("Id") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_id"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_code"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_desc"); + + b.Property("Latitude") + .HasColumnType("double") + .HasColumnName("stop_lat"); + + b.Property("Longitude") + .HasColumnType("double") + .HasColumnName("stop_lon"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_name"); + + b.Property("Timezone") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("stop_timezone"); + + b.Property("Url") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_url"); + + b.Property("WheelchairBoarding") + .HasColumnType("int") + .HasColumnName("wheelchair_boarding"); + + b.HasKey("Id"); + + b.ToTable("stops"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.StopTime", b => + { + b.Property("TripId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("trip_id"); + + b.Property("StopSequence") + .HasColumnType("int") + .HasColumnName("stop_sequence"); + + b.Property("ArrivalTime") + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("arrival_time"); + + b.Property("DepartureTime") + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("departure_time"); + + b.Property("ShapeDistTraveled") + .HasColumnType("double") + .HasColumnName("shape_dist_traveled"); + + b.Property("StopId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_id"); + + b.HasKey("TripId", "StopSequence"); + + b.HasIndex("StopId"); + + b.ToTable("stop_times"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Trip", b => + { + b.Property("TripId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("trip_id"); + + b.Property("BlockId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("block_id"); + + b.Property("DirectionId") + .HasColumnType("int") + .HasColumnName("direction_id"); + + b.Property("RouteId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("route_id"); + + b.Property("ServiceId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("ShapeId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("shape_id"); + + b.Property("TripBikesAllowed") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("trip_bikes_allowed"); + + b.Property("TripHeadsign") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("trip_headsign"); + + b.Property("TripShortName") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("trip_short_name"); + + b.Property("TripWheelchairAccessible") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("trip_wheelchair_accessible"); + + b.HasKey("TripId"); + + b.HasIndex("RouteId"); + + b.ToTable("trips"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Route", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Agency", "Agency") + .WithMany() + .HasForeignKey("AgencyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agency"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.StopTime", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Stop", "Stop") + .WithMany() + .HasForeignKey("StopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Trip", "Trip") + .WithMany() + .HasForeignKey("TripId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Stop"); + + b.Navigation("Trip"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Trip", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Route", null) + .WithMany() + .HasForeignKey("RouteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.cs new file mode 100644 index 0000000..3cf6ab8 --- /dev/null +++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/20250821135143_InitialGtfsData.cs @@ -0,0 +1,215 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Costasdev.Busurbano.Database.Migrations +{ + /// + public partial class InitialGtfsData : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "agencies", + columns: table => new + { + agency_id = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + agency_name = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + agency_url = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + agency_timezone = table.Column(type: "varchar(50)", maxLength: 50, nullable: false), + agency_lang = table.Column(type: "varchar(5)", maxLength: 5, nullable: false), + agency_phone = table.Column(type: "varchar(30)", maxLength: 30, nullable: true), + agency_email = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + agency_fare_url = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_agencies", x => x.agency_id); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "calendar", + columns: table => new + { + service_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + monday = table.Column(type: "tinyint(1)", nullable: false), + tuesday = table.Column(type: "tinyint(1)", nullable: false), + wednesday = table.Column(type: "tinyint(1)", nullable: false), + thursday = table.Column(type: "tinyint(1)", nullable: false), + friday = table.Column(type: "tinyint(1)", nullable: false), + saturday = table.Column(type: "tinyint(1)", nullable: false), + sunday = table.Column(type: "tinyint(1)", nullable: false), + start_date = table.Column(type: "date", nullable: false), + end_date = table.Column(type: "date", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_calendar", x => x.service_id); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "calendar_dates", + columns: table => new + { + service_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + date = table.Column(type: "date", nullable: false), + exception_type = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_calendar_dates", x => new { x.service_id, x.date }); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stops", + columns: table => new + { + stop_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + stop_code = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + stop_name = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + stop_desc = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + stop_lat = table.Column(type: "double", nullable: false), + stop_lon = table.Column(type: "double", nullable: false), + stop_url = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + stop_timezone = table.Column(type: "varchar(50)", maxLength: 50, nullable: true), + wheelchair_boarding = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_stops", x => x.stop_id); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "routes", + columns: table => new + { + route_id = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + agency_id = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + route_short_name = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + route_long_name = table.Column(type: "varchar(255)", maxLength: 255, nullable: false), + route_desc = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + route_type = table.Column(type: "int", nullable: false), + route_url = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + route_color = table.Column(type: "varchar(7)", maxLength: 7, nullable: true), + route_text_color = table.Column(type: "varchar(7)", maxLength: 7, nullable: true), + route_sort_order = table.Column(type: "int", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_routes", x => x.route_id); + table.ForeignKey( + name: "FK_routes_agencies_agency_id", + column: x => x.agency_id, + principalTable: "agencies", + principalColumn: "agency_id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "trips", + columns: table => new + { + trip_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + route_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + service_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + trip_headsign = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + trip_short_name = table.Column(type: "varchar(255)", maxLength: 255, nullable: true), + direction_id = table.Column(type: "int", nullable: false), + block_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: true), + shape_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: true), + trip_wheelchair_accessible = table.Column(type: "int", nullable: false, defaultValue: 0), + trip_bikes_allowed = table.Column(type: "int", nullable: false, defaultValue: 0) + }, + constraints: table => + { + table.PrimaryKey("PK_trips", x => x.trip_id); + table.ForeignKey( + name: "FK_trips_routes_route_id", + column: x => x.route_id, + principalTable: "routes", + principalColumn: "route_id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "stop_times", + columns: table => new + { + trip_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + stop_sequence = table.Column(type: "int", nullable: false), + arrival_time = table.Column(type: "varchar(8)", maxLength: 8, nullable: false), + departure_time = table.Column(type: "varchar(8)", maxLength: 8, nullable: false), + stop_id = table.Column(type: "varchar(32)", maxLength: 32, nullable: false), + shape_dist_traveled = table.Column(type: "double", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_stop_times", x => new { x.trip_id, x.stop_sequence }); + table.ForeignKey( + name: "FK_stop_times_stops_stop_id", + column: x => x.stop_id, + principalTable: "stops", + principalColumn: "stop_id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_stop_times_trips_trip_id", + column: x => x.trip_id, + principalTable: "trips", + principalColumn: "trip_id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySQL:Charset", "utf8mb4"); + + migrationBuilder.CreateIndex( + name: "IX_routes_agency_id", + table: "routes", + column: "agency_id"); + + migrationBuilder.CreateIndex( + name: "IX_stop_times_stop_id", + table: "stop_times", + column: "stop_id"); + + migrationBuilder.CreateIndex( + name: "IX_trips_route_id", + table: "trips", + column: "route_id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "calendar"); + + migrationBuilder.DropTable( + name: "calendar_dates"); + + migrationBuilder.DropTable( + name: "stop_times"); + + migrationBuilder.DropTable( + name: "stops"); + + migrationBuilder.DropTable( + name: "trips"); + + migrationBuilder.DropTable( + name: "routes"); + + migrationBuilder.DropTable( + name: "agencies"); + } + } +} diff --git a/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/AppDbContextModelSnapshot.cs b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/AppDbContextModelSnapshot.cs new file mode 100644 index 0000000..a77ecf5 --- /dev/null +++ b/src/Costasdev.Busurbano.ServiceViewer/Data/Migrations/AppDbContextModelSnapshot.cs @@ -0,0 +1,395 @@ +// +using System; +using Costasdev.Busurbano.Database; +using Costasdev.ServiceViewer; +using Costasdev.ServiceViewer.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Costasdev.Busurbano.Database.Migrations +{ + [DbContext(typeof(AppDbContext))] + partial class AppDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "9.0.8") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Agency", b => + { + b.Property("Id") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_id"); + + b.Property("Email") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_email"); + + b.Property("FareUrl") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_fare_url"); + + b.Property("Language") + .IsRequired() + .HasMaxLength(5) + .HasColumnType("varchar(5)") + .HasColumnName("agency_lang"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_name"); + + b.Property("Phone") + .HasMaxLength(30) + .HasColumnType("varchar(30)") + .HasColumnName("agency_phone"); + + b.Property("Timezone") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("agency_timezone"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_url"); + + b.HasKey("Id"); + + b.ToTable("agencies"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Calendar", b => + { + b.Property("ServiceId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("EndDate") + .HasColumnType("date") + .HasColumnName("end_date"); + + b.Property("Friday") + .HasColumnType("tinyint(1)") + .HasColumnName("friday"); + + b.Property("Monday") + .HasColumnType("tinyint(1)") + .HasColumnName("monday"); + + b.Property("Saturday") + .HasColumnType("tinyint(1)") + .HasColumnName("saturday"); + + b.Property("StartDate") + .HasColumnType("date") + .HasColumnName("start_date"); + + b.Property("Sunday") + .HasColumnType("tinyint(1)") + .HasColumnName("sunday"); + + b.Property("Thursday") + .HasColumnType("tinyint(1)") + .HasColumnName("thursday"); + + b.Property("Tuesday") + .HasColumnType("tinyint(1)") + .HasColumnName("tuesday"); + + b.Property("Wednesday") + .HasColumnType("tinyint(1)") + .HasColumnName("wednesday"); + + b.HasKey("ServiceId"); + + b.ToTable("calendar"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.CalendarDate", b => + { + b.Property("ServiceId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("Date") + .HasColumnType("date") + .HasColumnName("date"); + + b.Property("ExceptionType") + .HasColumnType("int") + .HasColumnName("exception_type"); + + b.HasKey("ServiceId", "Date"); + + b.ToTable("calendar_dates"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Route", b => + { + b.Property("Id") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_id"); + + b.Property("AgencyId") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("agency_id"); + + b.Property("Color") + .HasMaxLength(7) + .HasColumnType("varchar(7)") + .HasColumnName("route_color"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_desc"); + + b.Property("LongName") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_long_name"); + + b.Property("ShortName") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("route_short_name"); + + b.Property("SortOrder") + .HasColumnType("int") + .HasColumnName("route_sort_order"); + + b.Property("TextColor") + .HasMaxLength(7) + .HasColumnType("varchar(7)") + .HasColumnName("route_text_color"); + + b.Property("Type") + .HasColumnType("int") + .HasColumnName("route_type"); + + b.Property("Url") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("route_url"); + + b.HasKey("Id"); + + b.HasIndex("AgencyId"); + + b.ToTable("routes"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Stop", b => + { + b.Property("Id") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_id"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_code"); + + b.Property("Description") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_desc"); + + b.Property("Latitude") + .HasColumnType("double") + .HasColumnName("stop_lat"); + + b.Property("Longitude") + .HasColumnType("double") + .HasColumnName("stop_lon"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_name"); + + b.Property("Timezone") + .HasMaxLength(50) + .HasColumnType("varchar(50)") + .HasColumnName("stop_timezone"); + + b.Property("Url") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("stop_url"); + + b.Property("WheelchairBoarding") + .HasColumnType("int") + .HasColumnName("wheelchair_boarding"); + + b.HasKey("Id"); + + b.ToTable("stops"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.StopTime", b => + { + b.Property("TripId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("trip_id"); + + b.Property("StopSequence") + .HasColumnType("int") + .HasColumnName("stop_sequence"); + + b.Property("ArrivalTime") + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("arrival_time"); + + b.Property("DepartureTime") + .HasMaxLength(8) + .HasColumnType("varchar(8)") + .HasColumnName("departure_time"); + + b.Property("ShapeDistTraveled") + .HasColumnType("double") + .HasColumnName("shape_dist_traveled"); + + b.Property("StopId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("stop_id"); + + b.HasKey("TripId", "StopSequence"); + + b.HasIndex("StopId"); + + b.ToTable("stop_times"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Trip", b => + { + b.Property("TripId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("trip_id"); + + b.Property("BlockId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("block_id"); + + b.Property("DirectionId") + .HasColumnType("int") + .HasColumnName("direction_id"); + + b.Property("RouteId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("route_id"); + + b.Property("ServiceId") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("service_id"); + + b.Property("ShapeId") + .HasMaxLength(32) + .HasColumnType("varchar(32)") + .HasColumnName("shape_id"); + + b.Property("TripBikesAllowed") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("trip_bikes_allowed"); + + b.Property("TripHeadsign") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("trip_headsign"); + + b.Property("TripShortName") + .HasMaxLength(255) + .HasColumnType("varchar(255)") + .HasColumnName("trip_short_name"); + + b.Property("TripWheelchairAccessible") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0) + .HasColumnName("trip_wheelchair_accessible"); + + b.HasKey("TripId"); + + b.HasIndex("RouteId"); + + b.ToTable("trips"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Route", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Agency", "Agency") + .WithMany() + .HasForeignKey("AgencyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Agency"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.StopTime", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Stop", "Stop") + .WithMany() + .HasForeignKey("StopId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Trip", "Trip") + .WithMany() + .HasForeignKey("TripId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Stop"); + + b.Navigation("Trip"); + }); + + modelBuilder.Entity("Costasdev.Busurbano.Database.Gtfs.Trip", b => + { + b.HasOne("Costasdev.Busurbano.Database.Gtfs.Route", null) + .WithMany() + .HasForeignKey("RouteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} -- cgit v1.3