2023-04-01 14:38:20 +04:00
|
|
|
|
// <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.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)");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("UserId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Builds");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.BuildComponent", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("ComponentId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("BuildId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("BuildId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasKey("ComponentId", "BuildId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
|
|
|
|
b.HasIndex("BuildId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("BuildComponent");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Comment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("BuildId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("BuildName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Text")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("nvarchar(max)");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasIndex("BuildId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
|
|
|
|
b.ToTable("Comments");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Component", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Components");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Good", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Goods");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Order", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<int>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.ToTable("Orders");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.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)");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("UserId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasIndex("UserId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
|
|
|
|
b.ToTable("Purchase");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.PurchaseBuild", b =>
|
|
|
|
|
{
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("PurchaseId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("BuildId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("BuildId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("PurchaseId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasKey("PurchaseId", "BuildId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
|
|
|
|
b.HasIndex("BuildId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("PurchaseId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("PurchasesBuilds");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.PurchaseGood", b =>
|
|
|
|
|
{
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("PurchaseId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.Property<int>("GoodId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("PurchaseId")
|
|
|
|
|
.HasColumnType("int");
|
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasKey("PurchaseId", "GoodId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
2023-04-01 16:34:06 +04:00
|
|
|
|
b.HasIndex("GoodId");
|
2023-04-01 14:38:20 +04:00
|
|
|
|
|
|
|
|
|
b.HasIndex("PurchaseId");
|
|
|
|
|
|
|
|
|
|
b.ToTable("PurchasesGoods");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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.BuildComponent", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Build", "Build")
|
|
|
|
|
.WithMany("Components")
|
|
|
|
|
.HasForeignKey("BuildId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Component", "Component")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ComponentId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Build");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Component");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Comment", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Build", "Build")
|
|
|
|
|
.WithMany()
|
2023-04-01 16:34:06 +04:00
|
|
|
|
.HasForeignKey("BuildId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Build");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Purchase", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User")
|
|
|
|
|
.WithMany()
|
2023-04-01 16:34:06 +04:00
|
|
|
|
.HasForeignKey("UserId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.PurchaseBuild", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Build", "Build")
|
|
|
|
|
.WithMany("Purchases")
|
|
|
|
|
.HasForeignKey("BuildId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Purchase", "Purchase")
|
|
|
|
|
.WithMany("Builds")
|
|
|
|
|
.HasForeignKey("PurchaseId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Build");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Purchase");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.PurchaseGood", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Good", "Good")
|
|
|
|
|
.WithMany()
|
2023-04-01 16:34:06 +04:00
|
|
|
|
.HasForeignKey("GoodId")
|
2023-04-01 14:38:20 +04:00
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("HardwareShopDatabaseImplement.Models.Purchase", "Purchase")
|
|
|
|
|
.WithMany("Goods")
|
|
|
|
|
.HasForeignKey("PurchaseId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Good");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Purchase");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Build", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Components");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Purchases");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Purchase", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Builds");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Goods");
|
|
|
|
|
});
|
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|