autobus-api_old/AutobusApi.Persistence/Migrations/20231101122211_initial_create.Designer.cs

1176 lines
44 KiB
C#

// <auto-generated />
using System;
using AutoubsApi.Persistence.Contexts;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using NetTopologySuite.Geometries;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace AutobusApi.Persistence.Migrations
{
[DbContext(typeof(PostgresContext))]
[Migration("20231101122211_initial_create")]
partial class initial_create
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.13")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.HasPostgresExtension(modelBuilder, "postgis");
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("AutobusApi.Domain.Entities.Address", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CityId")
.HasColumnType("int")
.HasColumnName("city_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<Point>("Location")
.IsRequired()
.HasColumnType("geography(point)")
.HasColumnName("location");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("name");
b.Property<string>("VehicleType")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("vehicle_type");
b.HasKey("Id");
b.HasIndex("CityId");
b.ToTable("addresses", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Carriage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("Capacity")
.HasColumnType("int")
.HasColumnName("capacity");
b.Property<bool>("HasOutlets")
.HasColumnType("boolean")
.HasColumnName("has_outlets");
b.Property<bool>("HasWiFi")
.HasColumnType("boolean")
.HasColumnName("has_wifi");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("Number")
.HasColumnType("int")
.HasColumnName("number");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("type");
b.HasKey("Id");
b.ToTable("carriages", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.City", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("name");
b.Property<int>("RegionId")
.HasColumnType("int")
.HasColumnName("region_id");
b.HasKey("Id");
b.HasIndex("RegionId");
b.ToTable("cities", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Company", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ContactEmail")
.IsRequired()
.HasColumnType("varchar(256)")
.HasColumnName("contact_email");
b.Property<string>("ContactPhoneNumber")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("contact_phone_number");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("LegalAddress")
.IsRequired()
.HasColumnType("varchar(256)")
.HasColumnName("legal_address");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("name");
b.HasKey("Id");
b.ToTable("companies", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Country", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("name");
b.HasKey("Id");
b.ToTable("countries", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Employee", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateOnly>("BirthDate")
.HasColumnType("date")
.HasColumnName("birth_date");
b.Property<int>("EmployerCompanyId")
.HasColumnType("int")
.HasColumnName("employer_company_id");
b.Property<string>("FisrtName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("first_name");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("LastName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("last_name");
b.Property<string>("Patronymic")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("patronymic");
b.Property<string>("Sex")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("sex");
b.HasKey("Id");
b.HasIndex("EmployerCompanyId");
b.ToTable("employees", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.EmployeeDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("EmployeeId")
.HasColumnType("int")
.HasColumnName("employee_id");
b.Property<string>("Information")
.IsRequired()
.HasColumnType("varchar(256)")
.HasColumnName("information");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("type");
b.HasKey("Id");
b.HasIndex("EmployeeId");
b.ToTable("employee_documents", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Region", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CountryId")
.HasColumnType("int")
.HasColumnName("country_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("name");
b.HasKey("Id");
b.HasIndex("CountryId");
b.ToTable("regions", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Review", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Comment")
.IsRequired()
.HasColumnType("varchar(128)")
.HasColumnName("comment");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<DateTime>("PostDateTimeUtc")
.HasColumnType("timestamp")
.HasColumnName("post_timestamp_utc");
b.Property<decimal>("Rating")
.HasColumnType("numeric(1,0)")
.HasColumnName("rating");
b.Property<int>("UserId")
.HasColumnType("int")
.HasColumnName("user_id");
b.Property<int>("VehicleEnrollmentId")
.HasColumnType("int")
.HasColumnName("vehicle_enrollment_id");
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("VehicleEnrollmentId");
b.ToTable("reviews", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Route", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.HasKey("Id");
b.ToTable("routes", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.RouteAddress", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("AddressId")
.HasColumnType("int")
.HasColumnName("address_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("Order")
.HasColumnType("int")
.HasColumnName("order");
b.Property<int>("RouteId")
.HasColumnType("int")
.HasColumnName("route_id");
b.HasKey("Id");
b.HasIndex("AddressId");
b.HasIndex("RouteId");
b.ToTable("route_addresses", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.RouteAddressDetails", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<double>("CostToNextAddress")
.HasColumnType("numeric(16,4)")
.HasColumnName("cost_to_next_address");
b.Property<TimeSpan>("CurrentAddressStopTime")
.HasColumnType("interval")
.HasColumnName("current_address_stop_time");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("RouteAddressId")
.HasColumnType("int")
.HasColumnName("route_address_id");
b.Property<TimeSpan>("TimeToNextAddress")
.HasColumnType("interval")
.HasColumnName("time_to_next_address");
b.Property<int>("VehicleEnrollmentId")
.HasColumnType("int")
.HasColumnName("vehicle_enrollment_id");
b.HasKey("Id");
b.HasIndex("RouteAddressId");
b.HasIndex("VehicleEnrollmentId");
b.ToTable("route_address_details", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Ticket", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("TicketGroupId")
.HasColumnType("int")
.HasColumnName("ticket_group_id");
b.Property<int>("VehicleEnrollmentId")
.HasColumnType("int")
.HasColumnName("vehicle_enrollment_id");
b.HasKey("Id");
b.HasIndex("TicketGroupId");
b.HasIndex("VehicleEnrollmentId");
b.ToTable("tickets", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TicketDocument", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("Information")
.IsRequired()
.HasColumnType("varchar(256)")
.HasColumnName("information");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("TicketGroupId")
.HasColumnType("int")
.HasColumnName("ticket_group_id");
b.Property<string>("Type")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("type");
b.HasKey("Id");
b.ToTable("ticket_documents", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TicketGroup", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("BuyerEmailAddress")
.IsRequired()
.HasColumnType("varchar(256)")
.HasColumnName("buyer_email");
b.Property<string>("BuyerFirstName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("buyer_first_name");
b.Property<string>("BuyerLastName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("buyer_last_name");
b.Property<string>("BuyerPhoneNumber")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("buyer_phone_number");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<bool>("IsReturned")
.HasColumnType("boolean")
.HasColumnName("is_returned");
b.Property<DateOnly>("PassengerBirthDate")
.HasColumnType("date")
.HasColumnName("passenger_birth_date");
b.Property<string>("PassengerFirstName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("passenger_first_name");
b.Property<string>("PassengerLastName")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("passenger_last_name");
b.Property<string>("PassengerPatronymic")
.IsRequired()
.HasColumnType("varchar(32)")
.HasColumnName("passenger_patronymic");
b.Property<string>("PassengerSex")
.IsRequired()
.HasColumnType("varchar(16)")
.HasColumnName("passenger_sex");
b.Property<DateTime>("PurchaseDateTimeUtc")
.HasColumnType("timestamp")
.HasColumnName("purchase_timestamp_utc");
b.Property<int>("TicketDocumentId")
.HasColumnType("int");
b.Property<int?>("UserId")
.HasColumnType("int")
.HasColumnName("user_id");
b.HasKey("Id");
b.HasIndex("TicketDocumentId")
.IsUnique();
b.HasIndex("UserId");
b.ToTable("ticket_groups", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TrainCarriage", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CarriageId")
.HasColumnType("int")
.HasColumnName("carriage_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("TrainId")
.HasColumnType("int")
.HasColumnName("train_id");
b.HasKey("Id");
b.HasIndex("TrainId");
b.ToTable("train_carriages", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.User", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.HasKey("Id");
b.ToTable("users", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Vehicle", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("CompanyId")
.HasColumnType("int")
.HasColumnName("company_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.HasKey("Id");
b.HasIndex("CompanyId");
b.ToTable("vehicles", (string)null);
b.UseTptMappingStrategy();
});
modelBuilder.Entity("AutobusApi.Domain.Entities.VehicleEnrollment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<DateTime>("DepartureDateTimeUtc")
.HasColumnType("timestamp")
.HasColumnName("departure_timestamp_utc");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("RouteId")
.HasColumnType("int")
.HasColumnName("route_id");
b.Property<int>("VehicleId")
.HasColumnType("int")
.HasColumnName("vehicle_id");
b.HasKey("Id");
b.HasIndex("RouteId");
b.HasIndex("VehicleId");
b.ToTable("vehicle_enrollments", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.VehicleEnrollmentEmployee", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int")
.HasColumnName("id");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<int>("EmployeeId")
.HasColumnType("int")
.HasColumnName("employee_id");
b.Property<bool>("IsDeleted")
.HasColumnType("boolean")
.HasColumnName("is_deleted");
b.Property<int>("VehicleEnrollmentId")
.HasColumnType("int")
.HasColumnName("vehicle_enrollment_id");
b.HasKey("Id");
b.HasIndex("EmployeeId");
b.HasIndex("VehicleEnrollmentId");
b.ToTable("vehicle_enrollment_employees", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Aircraft", b =>
{
b.HasBaseType("AutobusApi.Domain.Entities.Vehicle");
b.Property<int>("Capacity")
.HasColumnType("int")
.HasColumnName("capacity");
b.Property<bool>("HasMultimedia")
.HasColumnType("boolean")
.HasColumnName("has_multimedia");
b.Property<bool>("HasWiFi")
.HasColumnType("boolean")
.HasColumnName("has_wifi");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("model");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("varchar(8)")
.HasColumnName("number");
b.ToTable("aircrafts", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Bus", b =>
{
b.HasBaseType("AutobusApi.Domain.Entities.Vehicle");
b.Property<int>("Capacity")
.HasColumnType("int")
.HasColumnName("capacity");
b.Property<bool>("HasClimateControl")
.HasColumnType("boolean")
.HasColumnName("has_climate_control");
b.Property<bool>("HasMultimedia")
.HasColumnType("boolean")
.HasColumnName("has_multimedia");
b.Property<bool>("HasOutlets")
.HasColumnType("boolean")
.HasColumnName("has_outlets");
b.Property<bool>("HasWC")
.HasColumnType("boolean")
.HasColumnName("has_wc");
b.Property<bool>("HasWiFi")
.HasColumnType("boolean")
.HasColumnName("has_wifi");
b.Property<string>("Model")
.IsRequired()
.HasColumnType("varchar(64)")
.HasColumnName("model");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("varchar(8)")
.HasColumnName("number");
b.ToTable("buses", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Train", b =>
{
b.HasBaseType("AutobusApi.Domain.Entities.Vehicle");
b.Property<string>("Number")
.IsRequired()
.HasColumnType("varchar(8)")
.HasColumnName("number");
b.ToTable("trains", (string)null);
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Address", b =>
{
b.HasOne("AutobusApi.Domain.Entities.City", "City")
.WithMany("Addresses")
.HasForeignKey("CityId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_addresses_city_id");
b.Navigation("City");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.City", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Region", "Region")
.WithMany("Cities")
.HasForeignKey("RegionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_cities_regions_regionId");
b.Navigation("Region");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Employee", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Company", "EmployerCompany")
.WithMany("Employees")
.HasForeignKey("EmployerCompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_employees_companies_employerCompanyId");
b.Navigation("EmployerCompany");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.EmployeeDocument", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Employee", "Employee")
.WithMany("Documents")
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_employeeDocuments_employees_employeeId");
b.Navigation("Employee");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Region", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Country", "Country")
.WithMany("Regions")
.HasForeignKey("CountryId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_regions_coutries_countryId");
b.Navigation("Country");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Review", b =>
{
b.HasOne("AutobusApi.Domain.Entities.User", "User")
.WithMany("Reviews")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_reviews_users_userId");
b.HasOne("AutobusApi.Domain.Entities.VehicleEnrollment", "VehicleEnrollment")
.WithMany("Reviews")
.HasForeignKey("VehicleEnrollmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_reviews_vehicleEnrollments_vehicleEnrollmentId");
b.Navigation("User");
b.Navigation("VehicleEnrollment");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.RouteAddress", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Address", "Address")
.WithMany("RouteAddresses")
.HasForeignKey("AddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_routeAddresses_addresses_addressId");
b.HasOne("AutobusApi.Domain.Entities.Route", "Route")
.WithMany("RouteAddresses")
.HasForeignKey("RouteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_routeAddresses_routes_routeId");
b.Navigation("Address");
b.Navigation("Route");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.RouteAddressDetails", b =>
{
b.HasOne("AutobusApi.Domain.Entities.RouteAddress", "RouteAddress")
.WithMany("RouteAddressDetails")
.HasForeignKey("RouteAddressId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_routeAddressDetails_routeAddress_routeAddressId");
b.HasOne("AutobusApi.Domain.Entities.VehicleEnrollment", "VehicleEnrollment")
.WithMany("RouteAddressDetails")
.HasForeignKey("VehicleEnrollmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_routeAddressDetails_vehicleEnrollments_vehicleEnrollmentId");
b.Navigation("RouteAddress");
b.Navigation("VehicleEnrollment");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Ticket", b =>
{
b.HasOne("AutobusApi.Domain.Entities.TicketGroup", "TicketGroup")
.WithMany("Tickets")
.HasForeignKey("TicketGroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_tickets_ticketGroups_ticketGroupId");
b.HasOne("AutobusApi.Domain.Entities.VehicleEnrollment", "VehicleEnrollment")
.WithMany("Tickets")
.HasForeignKey("VehicleEnrollmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_tickets_vehicleEnrollments_vehicleEnrollmentId");
b.Navigation("TicketGroup");
b.Navigation("VehicleEnrollment");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TicketGroup", b =>
{
b.HasOne("AutobusApi.Domain.Entities.TicketDocument", "TicketDocument")
.WithOne("TicketGroup")
.HasForeignKey("AutobusApi.Domain.Entities.TicketGroup", "TicketDocumentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_ticketGroups_ticketDocuments_ticketDocumentId");
b.HasOne("AutobusApi.Domain.Entities.User", "User")
.WithMany("TicketGroups")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.HasConstraintName("fk_ticketGroups_users_userId");
b.Navigation("TicketDocument");
b.Navigation("User");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TrainCarriage", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Carriage", "Carriage")
.WithMany("TrainCarriage")
.HasForeignKey("TrainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_trainCarriages_trains_carriageId");
b.HasOne("AutobusApi.Domain.Entities.Train", "Train")
.WithMany("TrainCarriage")
.HasForeignKey("TrainId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_trainCarriages_trains_trainId");
b.Navigation("Carriage");
b.Navigation("Train");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Vehicle", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Company", "Company")
.WithMany("Vehicles")
.HasForeignKey("CompanyId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_vehicles_companies_companyId");
b.Navigation("Company");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.VehicleEnrollment", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Route", "Route")
.WithMany("VehicleEnrollments")
.HasForeignKey("RouteId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_vehicleEnrollments_routes_routeId");
b.HasOne("AutobusApi.Domain.Entities.Vehicle", "Vehicle")
.WithMany("Enrollments")
.HasForeignKey("VehicleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_vehicleEnrollments_vehicles_vehicleId");
b.Navigation("Route");
b.Navigation("Vehicle");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.VehicleEnrollmentEmployee", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Employee", "Employee")
.WithMany("Shifts")
.HasForeignKey("EmployeeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_vehicleEnrollmentEmployees_employees_employeeId");
b.HasOne("AutobusApi.Domain.Entities.VehicleEnrollment", "VehicleEnrollment")
.WithMany("Crew")
.HasForeignKey("VehicleEnrollmentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_vehicleEnrollmentEmployees_vehicleEnrollments_vehicleEnrollmentId");
b.Navigation("Employee");
b.Navigation("VehicleEnrollment");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Aircraft", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Vehicle", "Vehicle")
.WithOne()
.HasForeignKey("AutobusApi.Domain.Entities.Aircraft", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_aircrafts_vehicles_id");
b.Navigation("Vehicle");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Bus", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Vehicle", "Vehicle")
.WithOne()
.HasForeignKey("AutobusApi.Domain.Entities.Bus", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_buses_vehicles_id");
b.Navigation("Vehicle");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Train", b =>
{
b.HasOne("AutobusApi.Domain.Entities.Vehicle", "Vehicle")
.WithOne()
.HasForeignKey("AutobusApi.Domain.Entities.Train", "Id")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired()
.HasConstraintName("fk_trains_vehicles_id");
b.Navigation("Vehicle");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Address", b =>
{
b.Navigation("RouteAddresses");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Carriage", b =>
{
b.Navigation("TrainCarriage");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.City", b =>
{
b.Navigation("Addresses");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Company", b =>
{
b.Navigation("Employees");
b.Navigation("Vehicles");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Country", b =>
{
b.Navigation("Regions");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Employee", b =>
{
b.Navigation("Documents");
b.Navigation("Shifts");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Region", b =>
{
b.Navigation("Cities");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Route", b =>
{
b.Navigation("RouteAddresses");
b.Navigation("VehicleEnrollments");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.RouteAddress", b =>
{
b.Navigation("RouteAddressDetails");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TicketDocument", b =>
{
b.Navigation("TicketGroup")
.IsRequired();
});
modelBuilder.Entity("AutobusApi.Domain.Entities.TicketGroup", b =>
{
b.Navigation("Tickets");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.User", b =>
{
b.Navigation("Reviews");
b.Navigation("TicketGroups");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Vehicle", b =>
{
b.Navigation("Enrollments");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.VehicleEnrollment", b =>
{
b.Navigation("Crew");
b.Navigation("Reviews");
b.Navigation("RouteAddressDetails");
b.Navigation("Tickets");
});
modelBuilder.Entity("AutobusApi.Domain.Entities.Train", b =>
{
b.Navigation("TrainCarriage");
});
#pragma warning restore 612, 618
}
}
}