PIbd-23_Starostin_I.K._Cour.../STODataBaseImplement/Migrations/STODatabaseModelSnapshot.cs

366 lines
12 KiB
C#

// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using STODatabaseImplement;
#nullable disable
namespace DatabaseImplement.Migrations
{
[DbContext(typeof(STODatabase))]
partial class STODatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
modelBuilder.Entity("DatabaseImplement.Car", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CarBrand")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CarModel")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("CarNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<DateTime>("Year")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Cars");
});
modelBuilder.Entity("DatabaseImplement.CarPart", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("CarPartName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<double>("Cost")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("CarParts");
});
modelBuilder.Entity("DatabaseImplement.CarPartWork", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("CarPartId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("WorkId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CarPartId");
b.HasIndex("WorkId");
b.ToTable("CarPartWork");
});
modelBuilder.Entity("DatabaseImplement.CarTechnicalWork", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("CarId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("TechnicalWorkId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CarId");
b.HasIndex("TechnicalWorkId");
b.ToTable("CarTechnicalWork");
});
modelBuilder.Entity("DatabaseImplement.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DatabaseImplement.Service", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("CarId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CarId");
b.HasIndex("ClientId");
b.ToTable("Services");
});
modelBuilder.Entity("DatabaseImplement.TechnicalWork", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<DateTime>("Date")
.HasColumnType("datetime2");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("TechnicalWorks");
});
modelBuilder.Entity("DatabaseImplement.Work", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Time_duration")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Works");
});
modelBuilder.Entity("DatabaseImplement.WorkTechnicalWork", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
b.Property<int>("Count")
.HasColumnType("int");
b.Property<int>("TechnicalWorkId")
.HasColumnType("int");
b.Property<int>("WorkId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("TechnicalWorkId");
b.HasIndex("WorkId");
b.ToTable("WorkTechnicalWork");
});
modelBuilder.Entity("DatabaseImplement.Car", b =>
{
b.HasOne("DatabaseImplement.Client", "Client")
.WithMany("Cars")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
});
modelBuilder.Entity("DatabaseImplement.CarPartWork", b =>
{
b.HasOne("DatabaseImplement.CarPart", "CarPart")
.WithMany()
.HasForeignKey("CarPartId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.Work", "Work")
.WithMany("CarPartCar")
.HasForeignKey("WorkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CarPart");
b.Navigation("Work");
});
modelBuilder.Entity("DatabaseImplement.CarTechnicalWork", b =>
{
b.HasOne("DatabaseImplement.Car", "Car")
.WithMany("TechnicalWorks")
.HasForeignKey("CarId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.TechnicalWork", "TechnicalWork")
.WithMany()
.HasForeignKey("TechnicalWorkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Car");
b.Navigation("TechnicalWork");
});
modelBuilder.Entity("DatabaseImplement.Service", b =>
{
b.HasOne("DatabaseImplement.Car", "Car")
.WithMany("Services")
.HasForeignKey("CarId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.Client", "Client")
.WithMany("Services")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Car");
b.Navigation("Client");
});
modelBuilder.Entity("DatabaseImplement.WorkTechnicalWork", b =>
{
b.HasOne("DatabaseImplement.TechnicalWork", "TechnicalWork")
.WithMany("Works")
.HasForeignKey("TechnicalWorkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.Work", "Work")
.WithMany()
.HasForeignKey("WorkId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("TechnicalWork");
b.Navigation("Work");
});
modelBuilder.Entity("DatabaseImplement.Car", b =>
{
b.Navigation("Services");
b.Navigation("TechnicalWorks");
});
modelBuilder.Entity("DatabaseImplement.Client", b =>
{
b.Navigation("Cars");
b.Navigation("Services");
});
modelBuilder.Entity("DatabaseImplement.TechnicalWork", b =>
{
b.Navigation("Works");
});
modelBuilder.Entity("DatabaseImplement.Work", b =>
{
b.Navigation("CarPartCar");
});
#pragma warning restore 612, 618
}
}
}