559 lines
19 KiB
C#
559 lines
19 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using ServiceStationDatabaseImplement;
|
|
|
|
#nullable disable
|
|
|
|
namespace ServiceStationDatabaseImplement.Migrations
|
|
{
|
|
[DbContext(typeof(ServiceStationDatabase))]
|
|
[Migration("20240428190245_InitMigration")]
|
|
partial class InitMigration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "7.0.18")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
|
|
|
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("CarBrand")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("CarNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ExecutorId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ExecutorId");
|
|
|
|
b.ToTable("Cars");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CarId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("DefectId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CarId");
|
|
|
|
b.HasIndex("DefectId");
|
|
|
|
b.ToTable("CarDefects");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("CarId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("TechnicalWorkId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CarId");
|
|
|
|
b.HasIndex("TechnicalWorkId");
|
|
|
|
b.ToTable("CarTechnicalWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<double>("DefectPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<string>("DefectType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<int>("ExecutorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("RepairId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ExecutorId");
|
|
|
|
b.HasIndex("RepairId");
|
|
|
|
b.ToTable("Defects");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("ExecutorEmail")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ExecutorFIO")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ExecutorNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("ExecutorPassword")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Executors");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<string>("GuarantorEmail")
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("GuarantorFIO")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("GuarantorNumber")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<string>("GuarantorPassword")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Guarantors");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("GuarantorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("RepairName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<double>("RepairPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("GuarantorId");
|
|
|
|
b.ToTable("Repairs");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("GuarantorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("SparePartName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<double>("SparePartPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("GuarantorId");
|
|
|
|
b.ToTable("SpareParts");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("RepairId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("SparePartId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("RepairId");
|
|
|
|
b.HasIndex("SparePartId");
|
|
|
|
b.ToTable("SparePartRepairs");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("SparePartId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("WorkId")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("SparePartId");
|
|
|
|
b.HasIndex("WorkId");
|
|
|
|
b.ToTable("SparePartWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<DateTime?>("DateStartWork")
|
|
.HasColumnType("datetime2");
|
|
|
|
b.Property<int>("ExecutorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<double>("WorkPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.Property<string>("WorkType")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ExecutorId");
|
|
|
|
b.ToTable("TechnicalWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
|
{
|
|
b.Property<int>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("int");
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
b.Property<int>("GuarantorId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("TechnicalWorkId")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("WorkName")
|
|
.IsRequired()
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
b.Property<double>("WorkPrice")
|
|
.HasColumnType("float");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("GuarantorId");
|
|
|
|
b.HasIndex("TechnicalWorkId");
|
|
|
|
b.ToTable("Works");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
|
.WithMany("Cars")
|
|
.HasForeignKey("ExecutorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Executor");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarDefect", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
|
.WithMany("CarDefects")
|
|
.HasForeignKey("CarId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Defect", "Defect")
|
|
.WithMany("Cars")
|
|
.HasForeignKey("DefectId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Car");
|
|
|
|
b.Navigation("Defect");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.CarTechnicalWork", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Car", "Car")
|
|
.WithMany("CarTechnicalWorks")
|
|
.HasForeignKey("CarId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.TechnicalWork", "TechnicalWork")
|
|
.WithMany("Cars")
|
|
.HasForeignKey("TechnicalWorkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Car");
|
|
|
|
b.Navigation("TechnicalWork");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
|
.WithMany("Defects")
|
|
.HasForeignKey("ExecutorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Repair", "Repair")
|
|
.WithMany("Defects")
|
|
.HasForeignKey("RepairId");
|
|
|
|
b.Navigation("Executor");
|
|
|
|
b.Navigation("Repair");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
|
.WithMany("Repairs")
|
|
.HasForeignKey("GuarantorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Guarantor");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
|
.WithMany("SpareParts")
|
|
.HasForeignKey("GuarantorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Guarantor");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartRepair", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Repair", "Repair")
|
|
.WithMany("SpareParts")
|
|
.HasForeignKey("RepairId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
|
.WithMany("SparePartRepairs")
|
|
.HasForeignKey("SparePartId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Repair");
|
|
|
|
b.Navigation("SparePart");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePartWork", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.SparePart", "SparePart")
|
|
.WithMany("SparePartWorks")
|
|
.HasForeignKey("SparePartId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Work", "Work")
|
|
.WithMany("SpareParts")
|
|
.HasForeignKey("WorkId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("SparePart");
|
|
|
|
b.Navigation("Work");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Executor", "Executor")
|
|
.WithMany("TechnicalWorks")
|
|
.HasForeignKey("ExecutorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Executor");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
|
{
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.Guarantor", "Guarantor")
|
|
.WithMany("Works")
|
|
.HasForeignKey("GuarantorId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("ServiceStationDatabaseImplement.Models.TechnicalWork", "TechnicalWork")
|
|
.WithMany("Works")
|
|
.HasForeignKey("TechnicalWorkId");
|
|
|
|
b.Navigation("Guarantor");
|
|
|
|
b.Navigation("TechnicalWork");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Car", b =>
|
|
{
|
|
b.Navigation("CarDefects");
|
|
|
|
b.Navigation("CarTechnicalWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Defect", b =>
|
|
{
|
|
b.Navigation("Cars");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Executor", b =>
|
|
{
|
|
b.Navigation("Cars");
|
|
|
|
b.Navigation("Defects");
|
|
|
|
b.Navigation("TechnicalWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Guarantor", b =>
|
|
{
|
|
b.Navigation("Repairs");
|
|
|
|
b.Navigation("SpareParts");
|
|
|
|
b.Navigation("Works");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Repair", b =>
|
|
{
|
|
b.Navigation("Defects");
|
|
|
|
b.Navigation("SpareParts");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.SparePart", b =>
|
|
{
|
|
b.Navigation("SparePartRepairs");
|
|
|
|
b.Navigation("SparePartWorks");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.TechnicalWork", b =>
|
|
{
|
|
b.Navigation("Cars");
|
|
|
|
b.Navigation("Works");
|
|
});
|
|
|
|
modelBuilder.Entity("ServiceStationDatabaseImplement.Models.Work", b =>
|
|
{
|
|
b.Navigation("SpareParts");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|