242 lines
8.2 KiB
C#
242 lines
8.2 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 RouteGuideDatabaseImplement;
|
|
|
|
#nullable disable
|
|
|
|
namespace RouteGuideDatabaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(RouteGuideDatabase))]
|
|
[Migration("20240407200755_InitialCreate")]
|
|
partial class InitialCreate
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.13")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Driver", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int?>("Experience")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("FullName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Phone")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Drivers");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Route", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("TransportId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TransportId");
|
|
|
|
b.ToTable("Routes");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.RouteStop", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Number")
|
|
.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("RouteStops");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Schedule", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime>("ArrivalTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("DepartureTime")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("Frequency")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("RouteId")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RouteId");
|
|
|
|
b.ToTable("Schedules");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Stop", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Number")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Street")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Stops");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Transport", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("integer");
|
|
|
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("Capacity")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("DriverId")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("License")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DriverId");
|
|
|
|
b.ToTable("Transport");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Route", b =>
|
|
{
|
|
b.HasOne("RouteGuideDatabaseImplement.Models.Transport", "Transport")
|
|
.WithMany()
|
|
.HasForeignKey("TransportId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Transport");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.RouteStop", b =>
|
|
{
|
|
b.HasOne("RouteGuideDatabaseImplement.Models.Route", "Route")
|
|
.WithMany("Stops")
|
|
.HasForeignKey("RouteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("RouteGuideDatabaseImplement.Models.Stop", "Stop")
|
|
.WithMany()
|
|
.HasForeignKey("StopId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Route");
|
|
|
|
b.Navigation("Stop");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Schedule", b =>
|
|
{
|
|
b.HasOne("RouteGuideDatabaseImplement.Models.Route", "Route")
|
|
.WithMany()
|
|
.HasForeignKey("RouteId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Route");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Transport", b =>
|
|
{
|
|
b.HasOne("RouteGuideDatabaseImplement.Models.Driver", "Driver")
|
|
.WithMany()
|
|
.HasForeignKey("DriverId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Driver");
|
|
});
|
|
|
|
modelBuilder.Entity("RouteGuideDatabaseImplement.Models.Route", b =>
|
|
{
|
|
b.Navigation("Stops");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|