Computer_Hardware_Store/HardwareShop/HardwareShopDatabaseImplement/Migrations/HardwareShopDatabaseModelSnapshot.cs
2023-04-01 16:42:28 +04:00

377 lines
13 KiB
C#

// <auto-generated />
using System;
using HardwareShopDatabaseImplement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace HardwareShopDatabaseImplement.Migrations
{
[DbContext(typeof(HardwareShopDatabase))]
partial class HardwareShopDatabaseModelSnapshot : 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("HardwareShopDatabaseImplement.Models.ManyToMany.BuildComponent", b =>
{
b.Property<int>("ComponentId")
.HasColumnType("int");
b.Property<int>("BuildId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.HasKey("ComponentId", "BuildId");
b.HasIndex("BuildId");
b.ToTable("BuildsComponents");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.ManyToMany.PurchaseBuild", b =>
{
b.Property<int>("PurchaseId")
.HasColumnType("int");
b.Property<int>("BuildId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.HasKey("PurchaseId", "BuildId");
b.HasIndex("BuildId");
b.ToTable("PurchasesBuilds");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.ManyToMany.PurchaseGood", b =>
{
b.Property<int>("PurchaseId")
.HasColumnType("int");
b.Property<int>("GoodId")
.HasColumnType("int");
b.Property<int>("Count")
.HasColumnType("int");
b.HasKey("PurchaseId", "GoodId");
b.HasIndex("GoodId");
b.ToTable("PurchasesGoods");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Components");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Good", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Goods");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Order", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Orders");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.User", 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>("Login")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<string>("Password")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<int>("Role")
.HasColumnType("int");
b.HasKey("Id");
b.ToTable("Users");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<string>("BuildName")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.Property<decimal>("Price")
.HasColumnType("decimal(18,2)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Builds");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<int>("BuildId")
.HasColumnType("int");
b.Property<string>("Text")
.IsRequired()
.HasColumnType("nvarchar(max)");
b.HasKey("Id");
b.HasIndex("BuildId");
b.ToTable("Comments");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
b.Property<DateTime?>("DatePurchase")
.HasColumnType("datetime2");
b.Property<int>("PurchaseStatus")
.HasColumnType("int");
b.Property<decimal>("Sum")
.HasColumnType("decimal(18,2)");
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Purchases");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.ManyToMany.BuildComponent", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.Worker.Build", "Build")
.WithMany("Components")
.HasForeignKey("BuildId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("HardwareShopDatabaseImplement.Models.Storekeeper.Component", "Component")
.WithMany()
.HasForeignKey("ComponentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Build");
b.Navigation("Component");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.ManyToMany.PurchaseBuild", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.Worker.Build", "Build")
.WithMany("Purchases")
.HasForeignKey("BuildId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("HardwareShopDatabaseImplement.Models.Worker.Purchase", "Purchase")
.WithMany("Builds")
.HasForeignKey("PurchaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Build");
b.Navigation("Purchase");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.ManyToMany.PurchaseGood", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.Storekeeper.Good", "Good")
.WithMany()
.HasForeignKey("GoodId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("HardwareShopDatabaseImplement.Models.Worker.Purchase", "Purchase")
.WithMany("Goods")
.HasForeignKey("PurchaseId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Good");
b.Navigation("Purchase");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Good", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Order", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.Worker.Build", "Build")
.WithMany("Comments")
.HasForeignKey("BuildId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Build");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b =>
{
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b =>
{
b.Navigation("Comments");
b.Navigation("Components");
b.Navigation("Purchases");
});
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b =>
{
b.Navigation("Builds");
b.Navigation("Goods");
});
#pragma warning restore 612, 618
}
}
}