//
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("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CarBrand")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CarModel")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("CarNumber")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("ClientId")
.HasColumnType("int");
b.Property("Year")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ClientId");
b.ToTable("Cars");
});
modelBuilder.Entity("DatabaseImplement.CarPart", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CarPartName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Cost")
.HasColumnType("float");
b.HasKey("Id");
b.ToTable("CarParts");
});
modelBuilder.Entity("DatabaseImplement.CarPartWork", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CarPartId")
.HasColumnType("int");
b.Property("Count")
.HasColumnType("int");
b.Property("WorkId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CarPartId");
b.HasIndex("WorkId");
b.ToTable("CarPartWork");
});
modelBuilder.Entity("DatabaseImplement.CarTechnicalWork", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CarId")
.HasColumnType("int");
b.Property("Count")
.HasColumnType("int");
b.Property("TechnicalWorkId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CarId");
b.HasIndex("TechnicalWorkId");
b.ToTable("CarTechnicalWork");
});
modelBuilder.Entity("DatabaseImplement.Client", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("ClientFIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Clients");
});
modelBuilder.Entity("DatabaseImplement.Service", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("CarId")
.HasColumnType("int");
b.Property("ClientId")
.HasColumnType("int");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CarId");
b.HasIndex("ClientId");
b.ToTable("Services");
});
modelBuilder.Entity("DatabaseImplement.TechnicalWork", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("Date")
.HasColumnType("datetime2");
b.Property("Description")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("TechnicalWorks");
});
modelBuilder.Entity("DatabaseImplement.Work", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property("Time_duration")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Works");
});
modelBuilder.Entity("DatabaseImplement.WorkTechnicalWork", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
b.Property("Count")
.HasColumnType("int");
b.Property("TechnicalWorkId")
.HasColumnType("int");
b.Property("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
}
}
}