PIbd-22_Fedorenko_Puchkina_.../LawFim/LawFirmDatabaseImplement/Migrations/LawFirmDatabaseModelSnapshot.cs

543 lines
19 KiB
C#
Raw Normal View History

// <auto-generated />
using System;
using LawFirmDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace LawFirmDatabaseImplement.Migrations
{
[DbContext(typeof(LawFirmDatabase))]
partial class LawFirmDatabaseModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.17")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Case", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("CaseType")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<DateTime>("DateCreate")
.HasColumnType("datetime2");
b.Property<DateTime?>("DateImplement")
.HasColumnType("datetime2");
b.Property<int>("ExecutorId")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Status")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ExecutorId");
b.ToTable("Cases", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.CaseClient", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CaseId")
.HasColumnType("int");
b.Property<int>("ClientId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CaseId");
b.HasIndex("ClientId");
b.ToTable("CaseClients", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("ExecutorId")
.HasColumnType("int");
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("ExecutorId");
b.ToTable("Clients", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Consultation", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CaseId")
.HasColumnType("int");
b.Property<DateTime>("ConsultationDate")
.HasColumnType("datetime2");
b.Property<double>("Cost")
.HasColumnType("float");
b.Property<int>("GuarantorId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CaseId");
b.HasIndex("GuarantorId");
b.ToTable("Consultations", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.ConsultationLawyer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ConsultationId")
.HasColumnType("int");
b.Property<int>("LawyerId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ConsultationId");
b.HasIndex("LawyerId");
b.ToTable("ConsultationLawyers", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Executor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Executors", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Guarantor", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Guarantors", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Hearing", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("GuarantorId")
.HasColumnType("int");
b.Property<DateTime>("HearingDate")
.HasColumnType("datetime2");
b.Property<string>("Judge")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("GuarantorId");
b.ToTable("Hearings", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.HearingLawyer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("HearingId")
.HasColumnType("int");
b.Property<int>("LawyerId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("HearingId");
b.HasIndex("LawyerId");
b.ToTable("HearingLawyers", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Lawyer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Email")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("FIO")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("GuarantorId")
.HasColumnType("int");
b.Property<string>("Phone")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("GuarantorId");
b.ToTable("Lawyers", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Visit", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ExecutorId")
.HasColumnType("int");
b.Property<int>("HearingId")
.HasColumnType("int");
b.Property<DateTime>("VisitDate")
.HasColumnType("datetime2");
b.HasKey("Id");
b.HasIndex("ExecutorId");
b.HasIndex("HearingId");
b.ToTable("Visits", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.VisitClient", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("ClientId")
.HasColumnType("int");
b.Property<int>("VisitId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasIndex("VisitId");
b.ToTable("VisitClients", (string)null);
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Case", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Executor", null)
.WithMany("Cases")
.HasForeignKey("ExecutorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.CaseClient", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Case", "Case")
.WithMany("Clients")
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Client", "Client")
.WithMany("CaseClients")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Case");
b.Navigation("Client");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Executor", null)
.WithMany("Clients")
.HasForeignKey("ExecutorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Consultation", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Case", "Case")
.WithMany()
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Guarantor", null)
.WithMany("Consultations")
.HasForeignKey("GuarantorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Case");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.ConsultationLawyer", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Consultation", "Consultation")
.WithMany("Lawyers")
.HasForeignKey("ConsultationId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Lawyer", "Lawyer")
.WithMany("ConsultationLawyers")
.HasForeignKey("LawyerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Consultation");
b.Navigation("Lawyer");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Hearing", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Guarantor", null)
.WithMany("Hearings")
.HasForeignKey("GuarantorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.HearingLawyer", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Hearing", "Hearing")
.WithMany("Lawyers")
.HasForeignKey("HearingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Lawyer", "Lawyer")
.WithMany("HearingLawyers")
.HasForeignKey("LawyerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Hearing");
b.Navigation("Lawyer");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Lawyer", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Guarantor", null)
.WithMany("Lawyers")
.HasForeignKey("GuarantorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Visit", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Executor", null)
.WithMany("Visits")
.HasForeignKey("ExecutorId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Hearing", "Hearing")
.WithMany()
.HasForeignKey("HearingId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Hearing");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.VisitClient", b =>
{
b.HasOne("LawFirmDatabaseImplement.Models.Client", "Client")
.WithMany("ClientVisits")
.HasForeignKey("ClientId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabaseImplement.Models.Visit", "Visit")
.WithMany("Clients")
.HasForeignKey("VisitId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Client");
b.Navigation("Visit");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Case", b =>
{
b.Navigation("Clients");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Client", b =>
{
b.Navigation("CaseClients");
b.Navigation("ClientVisits");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Consultation", b =>
{
b.Navigation("Lawyers");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Executor", b =>
{
b.Navigation("Cases");
b.Navigation("Clients");
b.Navigation("Visits");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Guarantor", b =>
{
b.Navigation("Consultations");
b.Navigation("Hearings");
b.Navigation("Lawyers");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Hearing", b =>
{
b.Navigation("Lawyers");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Lawyer", b =>
{
b.Navigation("ConsultationLawyers");
b.Navigation("HearingLawyers");
});
modelBuilder.Entity("LawFirmDatabaseImplement.Models.Visit", b =>
{
b.Navigation("Clients");
});
#pragma warning restore 612, 618
}
}
}