164 lines
5.6 KiB
C#
164 lines
5.6 KiB
C#
// <auto-generated />
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using TransportGuideDatabaseImplements;
|
|
|
|
#nullable disable
|
|
|
|
namespace TransportGuideDatabaseImplements.Migrations
|
|
{
|
|
[DbContext(typeof(TransportGuideDB))]
|
|
[Migration("20230504163433_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.5")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.Route", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("IP")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("TransportTypeId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TransportTypeId");
|
|
|
|
b.ToTable("Routes");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.Stop", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Stops");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.StopRoute", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Nomer")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RouteId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("StopId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RouteId");
|
|
|
|
b.HasIndex("StopId");
|
|
|
|
b.ToTable("StopRoutes");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.TransportType", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<double>("Price")
|
|
.HasColumnType("double precision");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("TransportTypes");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.Route", b =>
|
|
{
|
|
b.HasOne("TransportGuideDatabaseImplements.Models.TransportType", "TransportType")
|
|
.WithMany("Routes")
|
|
.HasForeignKey("TransportTypeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("TransportType");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.StopRoute", b =>
|
|
{
|
|
b.HasOne("TransportGuideDatabaseImplements.Models.Route", "Route")
|
|
.WithMany("Stops")
|
|
.HasForeignKey("RouteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("TransportGuideDatabaseImplements.Models.Stop", "Stop")
|
|
.WithMany("StopRoutes")
|
|
.HasForeignKey("StopId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Route");
|
|
|
|
b.Navigation("Stop");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.Route", b =>
|
|
{
|
|
b.Navigation("Stops");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.Stop", b =>
|
|
{
|
|
b.Navigation("StopRoutes");
|
|
});
|
|
|
|
modelBuilder.Entity("TransportGuideDatabaseImplements.Models.TransportType", b =>
|
|
{
|
|
b.Navigation("Routes");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|