2023-04-08 07:28:40 +04:00

226 lines
7.4 KiB
C#

// <auto-generated />
using LawFirmDatabase;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace LawFirmDatabase.Migrations
{
[DbContext(typeof(LawFirmDBContext))]
partial class LawFirmDBContextModelSnapshot : ModelSnapshot
{
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "7.0.4")
.HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("LawFirmDatabase.Models.Case", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CustomerId")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("CustomerId");
b.ToTable("Cases");
});
modelBuilder.Entity("LawFirmDatabase.Models.Customer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Login")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Surname")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.ToTable("Customers");
});
modelBuilder.Entity("LawFirmDatabase.Models.Item", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("PaymentId")
.HasColumnType("int");
b.Property<decimal>("Price")
.HasColumnType("decimal (10,2)");
b.HasKey("Id");
b.HasIndex("PaymentId");
b.ToTable("Items");
});
modelBuilder.Entity("LawFirmDatabase.Models.Payment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CaseId")
.HasColumnType("int");
b.Property<decimal>("Sum")
.HasColumnType("decimal (10,2)");
b.HasKey("Id");
b.HasIndex("CaseId");
b.ToTable("Payments");
});
modelBuilder.Entity("LawFirmDatabase.Models.Service", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CaseId")
.HasColumnType("int");
b.Property<int>("ItemId")
.HasColumnType("int");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Price")
.HasColumnType("decimal (10,2)");
b.HasKey("Id");
b.HasIndex("CaseId");
b.HasIndex("ItemId");
b.ToTable("Services");
});
modelBuilder.Entity("LawFirmDatabase.Models.Case", b =>
{
b.HasOne("LawFirmDatabase.Models.Customer", "Customer")
.WithMany("Cases")
.HasForeignKey("CustomerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Customer");
});
modelBuilder.Entity("LawFirmDatabase.Models.Item", b =>
{
b.HasOne("LawFirmDatabase.Models.Payment", "Payments")
.WithMany("Items")
.HasForeignKey("PaymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Payments");
});
modelBuilder.Entity("LawFirmDatabase.Models.Payment", b =>
{
b.HasOne("LawFirmDatabase.Models.Case", "Cases")
.WithMany("Payments")
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Cases");
});
modelBuilder.Entity("LawFirmDatabase.Models.Service", b =>
{
b.HasOne("LawFirmDatabase.Models.Case", "Cases")
.WithMany()
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabase.Models.Item", "Items")
.WithMany("Services")
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Cases");
b.Navigation("Items");
});
modelBuilder.Entity("LawFirmDatabase.Models.Case", b =>
{
b.Navigation("Payments");
});
modelBuilder.Entity("LawFirmDatabase.Models.Customer", b =>
{
b.Navigation("Cases");
});
modelBuilder.Entity("LawFirmDatabase.Models.Item", b =>
{
b.Navigation("Services");
});
modelBuilder.Entity("LawFirmDatabase.Models.Payment", b =>
{
b.Navigation("Items");
});
#pragma warning restore 612, 618
}
}
}