feat: add UserManagementService feat: add CopmanyDriver relation and DriverManagementService chore: pupulate database seeding class fix: add review filtering by CompanyId
963 lines
33 KiB
C#
963 lines
33 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Server.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace Server.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20230501105408_Add_CompanyDriver_relation")]
|
|
partial class Add_CompanyDriver_relation
|
|
{
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "6.0.9")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("NormalizedName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedName")
|
|
.IsUnique()
|
|
.HasDatabaseName("RoleNameIndex");
|
|
|
|
b.ToTable("AspNetRoles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("RoleId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("AspNetRoleClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ClaimType")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ClaimValue")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserClaims", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
|
{
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ProviderKey")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("ProviderDisplayName")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("LoginProvider", "ProviderKey");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("AspNetUserLogins", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
|
{
|
|
b.Property<string>("UserId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("RoleId")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("UserId", "RoleId");
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
b.ToTable("AspNetUserRoles", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
|
{
|
|
b.Property<string>("UserId")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("LoginProvider")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Value")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("UserId", "LoginProvider", "Name");
|
|
|
|
b.ToTable("AspNetUserTokens", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Address", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CityId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<double>("Latitude")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<double>("Longitude")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CityId");
|
|
|
|
b.ToTable("Addresses");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.City", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("StateId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("StateId");
|
|
|
|
b.ToTable("Cities");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Company", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("OwnerId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Companies");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.CompanyDriver", b =>
|
|
{
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("DriverId")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("CompanyId", "DriverId");
|
|
|
|
b.HasIndex("DriverId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("CompanyDrivers");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Country", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Code")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Countries");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Review", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Comment")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime>("PostDateTimeUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Rating")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("VehicleEnrollmentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.HasIndex("VehicleEnrollmentId");
|
|
|
|
b.ToTable("Reviews");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Route", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Routes");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.RouteAddress", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("AddressId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Order")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RouteAddressDetailsId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RouteId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AddressId");
|
|
|
|
b.HasIndex("RouteId");
|
|
|
|
b.ToTable("RouteAddresses");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.RouteAddressDetails", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<double>("CostToNextCity")
|
|
.HasColumnType("double precision");
|
|
|
|
b.Property<int>("RouteAddressId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<TimeSpan>("TimeSpanToNextCity")
|
|
.HasColumnType("interval");
|
|
|
|
b.Property<int>("VehicleEnrollmentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<TimeSpan>("WaitTimeSpan")
|
|
.HasColumnType("interval");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RouteAddressId");
|
|
|
|
b.HasIndex("VehicleEnrollmentId");
|
|
|
|
b.ToTable("RouteAddressDetails");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.State", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CountryId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CountryId");
|
|
|
|
b.ToTable("States");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Ticket", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("FirstRouteAddressId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsMissed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsReturned")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("LastRouteAddressId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("PurchaseDateTimeUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("TicketGroupId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("VehicleEnrollmentId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TicketGroupId");
|
|
|
|
b.HasIndex("VehicleEnrollmentId");
|
|
|
|
b.ToTable("Tickets");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.TicketGroup", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("UserId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("TicketGroups");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.User", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime?>("BirthDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.IsConcurrencyToken()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("Document")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("DocumentDetails")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Email")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("FirstName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int?>("Gender")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("LastName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Patronymic")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("NormalizedEmail")
|
|
.HasDatabaseName("EmailIndex");
|
|
|
|
b.ToTable("AspNetUsers", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Vehicle", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Capacity")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("CompanyId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("HasBelts")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasClimateControl")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasOutlet")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasStewardess")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasTV")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasWC")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("HasWiFi")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Number")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("Vehicles");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.VehicleEnrollment", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("CancelationComment")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<TimeSpan?>("DelayTimeSpan")
|
|
.HasColumnType("interval");
|
|
|
|
b.Property<DateTime>("DepartureDateTimeUtc")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsCanceled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<int>("RouteId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("VehicleId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RouteId");
|
|
|
|
b.HasIndex("VehicleId");
|
|
|
|
b.ToTable("VehicleEnrollments");
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
|
{
|
|
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
|
.WithMany()
|
|
.HasForeignKey("RoleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Address", b =>
|
|
{
|
|
b.HasOne("Server.Models.City", "City")
|
|
.WithMany("Addresses")
|
|
.HasForeignKey("CityId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("City");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.City", b =>
|
|
{
|
|
b.HasOne("Server.Models.State", "State")
|
|
.WithMany("Cities")
|
|
.HasForeignKey("StateId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("State");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Company", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", "Owner")
|
|
.WithOne("Company")
|
|
.HasForeignKey("Server.Models.Company", "OwnerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Owner");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.CompanyDriver", b =>
|
|
{
|
|
b.HasOne("Server.Models.Company", "Company")
|
|
.WithMany("CompanyDrivers")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.User", "Driver")
|
|
.WithOne("Employer")
|
|
.HasForeignKey("Server.Models.CompanyDriver", "DriverId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
|
|
b.Navigation("Driver");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Review", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", "User")
|
|
.WithMany("Reviews")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.VehicleEnrollment", "VehicleEnrollment")
|
|
.WithMany("Reviews")
|
|
.HasForeignKey("VehicleEnrollmentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
|
|
b.Navigation("VehicleEnrollment");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.RouteAddress", b =>
|
|
{
|
|
b.HasOne("Server.Models.Address", "Address")
|
|
.WithMany("RouteAddresses")
|
|
.HasForeignKey("AddressId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.Route", "Route")
|
|
.WithMany("RouteAddresses")
|
|
.HasForeignKey("RouteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Address");
|
|
|
|
b.Navigation("Route");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.RouteAddressDetails", b =>
|
|
{
|
|
b.HasOne("Server.Models.RouteAddress", "RouteAddress")
|
|
.WithMany("RouteAddressDetails")
|
|
.HasForeignKey("RouteAddressId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.VehicleEnrollment", "VehicleEnrollment")
|
|
.WithMany("RouteAddressDetails")
|
|
.HasForeignKey("VehicleEnrollmentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("RouteAddress");
|
|
|
|
b.Navigation("VehicleEnrollment");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.State", b =>
|
|
{
|
|
b.HasOne("Server.Models.Country", "Country")
|
|
.WithMany("States")
|
|
.HasForeignKey("CountryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Country");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Ticket", b =>
|
|
{
|
|
b.HasOne("Server.Models.TicketGroup", "TicketGroup")
|
|
.WithMany("Tickets")
|
|
.HasForeignKey("TicketGroupId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.VehicleEnrollment", "VehicleEnrollment")
|
|
.WithMany("Tickets")
|
|
.HasForeignKey("VehicleEnrollmentId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("TicketGroup");
|
|
|
|
b.Navigation("VehicleEnrollment");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.TicketGroup", b =>
|
|
{
|
|
b.HasOne("Server.Models.User", "User")
|
|
.WithMany("TicketGroups")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.User", b =>
|
|
{
|
|
b.OwnsMany("Server.Models.RefreshToken", "RefreshTokens", b1 =>
|
|
{
|
|
b1.Property<string>("UserId")
|
|
.HasColumnType("text");
|
|
|
|
b1.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b1.Property<int>("Id"));
|
|
|
|
b1.Property<DateTime>("CreationDateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b1.Property<DateTime>("ExpiryDateTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b1.Property<DateTime?>("Revoked")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b1.Property<string>("Token")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b1.HasKey("UserId", "Id");
|
|
|
|
b1.ToTable("RefreshToken");
|
|
|
|
b1.WithOwner()
|
|
.HasForeignKey("UserId");
|
|
});
|
|
|
|
b.Navigation("RefreshTokens");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Vehicle", b =>
|
|
{
|
|
b.HasOne("Server.Models.Company", "Company")
|
|
.WithMany("Vehicles")
|
|
.HasForeignKey("CompanyId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.VehicleEnrollment", b =>
|
|
{
|
|
b.HasOne("Server.Models.Route", "Route")
|
|
.WithMany("VehicleEnrollments")
|
|
.HasForeignKey("RouteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Server.Models.Vehicle", "Vehicle")
|
|
.WithMany("VehicleEnrollments")
|
|
.HasForeignKey("VehicleId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Route");
|
|
|
|
b.Navigation("Vehicle");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Address", b =>
|
|
{
|
|
b.Navigation("RouteAddresses");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.City", b =>
|
|
{
|
|
b.Navigation("Addresses");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Company", b =>
|
|
{
|
|
b.Navigation("CompanyDrivers");
|
|
|
|
b.Navigation("Vehicles");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Country", b =>
|
|
{
|
|
b.Navigation("States");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Route", b =>
|
|
{
|
|
b.Navigation("RouteAddresses");
|
|
|
|
b.Navigation("VehicleEnrollments");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.RouteAddress", b =>
|
|
{
|
|
b.Navigation("RouteAddressDetails");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.State", b =>
|
|
{
|
|
b.Navigation("Cities");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.TicketGroup", b =>
|
|
{
|
|
b.Navigation("Tickets");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.User", b =>
|
|
{
|
|
b.Navigation("Company")
|
|
.IsRequired();
|
|
|
|
b.Navigation("Employer")
|
|
.IsRequired();
|
|
|
|
b.Navigation("Reviews");
|
|
|
|
b.Navigation("TicketGroups");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.Vehicle", b =>
|
|
{
|
|
b.Navigation("VehicleEnrollments");
|
|
});
|
|
|
|
modelBuilder.Entity("Server.Models.VehicleEnrollment", b =>
|
|
{
|
|
b.Navigation("Reviews");
|
|
|
|
b.Navigation("RouteAddressDetails");
|
|
|
|
b.Navigation("Tickets");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|