2024-06-04 22:52:01 +04:00
|
|
|
|
// <auto-generated />
|
|
|
|
|
using System;
|
|
|
|
|
using DatabaseImplement;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
|
|
|
|
|
|
#nullable disable
|
|
|
|
|
|
|
|
|
|
namespace DatabaseImplement.Migrations
|
|
|
|
|
{
|
|
|
|
|
[DbContext(typeof(Database))]
|
|
|
|
|
partial class DatabaseModelSnapshot : ModelSnapshot
|
|
|
|
|
{
|
|
|
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
#pragma warning disable 612, 618
|
|
|
|
|
modelBuilder
|
|
|
|
|
.HasAnnotation("ProductVersion", "8.0.6")
|
|
|
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
|
|
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.MediaFile", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Location")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProductId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("MediaFiles", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Amount")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<bool>("IsBeingSold")
|
|
|
|
|
.HasColumnType("boolean");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Rate")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Products", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Purchase", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DatePurchase")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Status")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
2024-06-23 17:04:11 +04:00
|
|
|
|
b.Property<Guid>("UserId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 17:04:11 +04:00
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Purchases", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
2024-06-23 17:04:11 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.PurchaseProducts", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProductId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("PurchaseId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("PurchaseId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("PurchaseProducts", (string)null);
|
2024-06-23 17:04:11 +04:00
|
|
|
|
});
|
|
|
|
|
|
2024-06-04 22:52:01 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Role", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Roles", (string)null);
|
2024-06-04 22:52:01 +04:00
|
|
|
|
});
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Sell", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("DateSell")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Sells", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Supplier", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Deals")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Suppliers", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.SupplierProduct", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProductId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("SupplierId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("SupplierId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("SupplierProducts", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Supply", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("Date")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Name")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<double>("Price")
|
|
|
|
|
.HasColumnType("double precision");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Status")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("SupplierId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("SupplierId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Supplies", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.SupplyProduct", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<int>("Count")
|
|
|
|
|
.HasColumnType("integer");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("ProductId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid>("SupplyId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("SupplyId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("SupplyProducts", (string)null);
|
2024-06-22 21:16:08 +04:00
|
|
|
|
});
|
|
|
|
|
|
2024-06-04 22:52:01 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.User", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Property<Guid>("Id")
|
|
|
|
|
.ValueGeneratedOnAdd()
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<DateTime>("Birthday")
|
|
|
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("Email")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("FirstName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
b.Property<bool>("OnlyImportantMails")
|
|
|
|
|
.HasColumnType("boolean");
|
|
|
|
|
|
2024-06-04 22:52:01 +04:00
|
|
|
|
b.Property<string>("PasswordHash")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.Property<Guid?>("RoleId")
|
|
|
|
|
.HasColumnType("uuid");
|
|
|
|
|
|
|
|
|
|
b.Property<string>("SecondName")
|
|
|
|
|
.IsRequired()
|
|
|
|
|
.HasColumnType("text");
|
|
|
|
|
|
|
|
|
|
b.HasKey("Id");
|
|
|
|
|
|
|
|
|
|
b.HasIndex("RoleId");
|
|
|
|
|
|
2024-06-23 20:39:28 +04:00
|
|
|
|
b.ToTable("Users", (string)null);
|
2024-06-04 22:52:01 +04:00
|
|
|
|
});
|
|
|
|
|
|
2024-06-23 17:04:11 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Purchase", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.User", "User")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("UserId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("User");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.PurchaseProducts", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Product", "Product")
|
|
|
|
|
.WithMany("PurchaseProducts")
|
|
|
|
|
.HasForeignKey("ProductId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Purchase", "Purchase")
|
|
|
|
|
.WithMany("Products")
|
|
|
|
|
.HasForeignKey("PurchaseId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Product");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Purchase");
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.SupplierProduct", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Product", "Product")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ProductId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Supplier", "Supplier")
|
|
|
|
|
.WithMany("Products")
|
|
|
|
|
.HasForeignKey("SupplierId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Product");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Supplier");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Supply", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Supplier", "Supplier")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("SupplierId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Supplier");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.SupplyProduct", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Product", "Product")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("ProductId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Supply", "Supply")
|
|
|
|
|
.WithMany("Products")
|
|
|
|
|
.HasForeignKey("SupplyId")
|
|
|
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
|
|
|
.IsRequired();
|
|
|
|
|
|
|
|
|
|
b.Navigation("Product");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Supply");
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-04 22:52:01 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.User", b =>
|
|
|
|
|
{
|
|
|
|
|
b.HasOne("DatabaseImplement.Models.Role", "Role")
|
|
|
|
|
.WithMany()
|
|
|
|
|
.HasForeignKey("RoleId");
|
|
|
|
|
|
|
|
|
|
b.Navigation("Role");
|
|
|
|
|
});
|
2024-06-22 21:16:08 +04:00
|
|
|
|
|
2024-06-23 17:04:11 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Product", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("PurchaseProducts");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Purchase", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Products");
|
|
|
|
|
});
|
|
|
|
|
|
2024-06-22 21:16:08 +04:00
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Supplier", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Products");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
modelBuilder.Entity("DatabaseImplement.Models.Supply", b =>
|
|
|
|
|
{
|
|
|
|
|
b.Navigation("Products");
|
|
|
|
|
});
|
2024-06-04 22:52:01 +04:00
|
|
|
|
#pragma warning restore 612, 618
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|