294 lines
9.6 KiB
C#

// <auto-generated />
using System;
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>("CaseId")
.HasColumnType("int");
b.Property<int>("CustomerId")
.HasColumnType("int");
b.Property<DateTime>("DateCreated")
.HasColumnType("date");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int?>("WorkerId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CaseId");
b.HasIndex("WorkerId");
b.ToTable("Cases");
});
modelBuilder.Entity("LawFirmDatabase.Models.CaseService", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("CaseId")
.HasColumnType("int");
b.Property<int>("ServiceId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("CaseId");
b.ToTable("CaseServices");
});
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<int>("ItemId")
.HasColumnType("int");
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("ItemId");
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<DateTime>("DatePayment")
.HasColumnType("date");
b.Property<decimal>("Sum")
.HasColumnType("decimal (15,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 (15,2)");
b.HasKey("Id");
b.HasIndex("CaseId");
b.ToTable("Services");
});
modelBuilder.Entity("LawFirmDatabase.Models.Worker", 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("Workers");
});
modelBuilder.Entity("LawFirmDatabase.Models.Case", b =>
{
b.HasOne("LawFirmDatabase.Models.Customer", "Customer")
.WithMany("Cases")
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LawFirmDatabase.Models.Worker", null)
.WithMany("Cases")
.HasForeignKey("WorkerId");
b.Navigation("Customer");
});
modelBuilder.Entity("LawFirmDatabase.Models.CaseService", b =>
{
b.HasOne("LawFirmDatabase.Models.Case", "Case")
.WithMany("CaseServices")
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Case");
});
modelBuilder.Entity("LawFirmDatabase.Models.Item", b =>
{
b.HasOne("LawFirmDatabase.Models.Payment", "Payment")
.WithMany()
.HasForeignKey("ItemId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Payment");
});
modelBuilder.Entity("LawFirmDatabase.Models.Payment", b =>
{
b.HasOne("LawFirmDatabase.Models.Case", "Case")
.WithMany()
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Case");
});
modelBuilder.Entity("LawFirmDatabase.Models.Service", b =>
{
b.HasOne("LawFirmDatabase.Models.Case", "Case")
.WithMany()
.HasForeignKey("CaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Case");
});
modelBuilder.Entity("LawFirmDatabase.Models.Case", b =>
{
b.Navigation("CaseServices");
});
modelBuilder.Entity("LawFirmDatabase.Models.Customer", b =>
{
b.Navigation("Cases");
});
modelBuilder.Entity("LawFirmDatabase.Models.Worker", b =>
{
b.Navigation("Cases");
});
#pragma warning restore 612, 618
}
}
}