PIAPS_CW/DatabaseImplement/Migrations/DatabaseModelSnapshot.cs

566 lines
18 KiB
C#
Raw Normal View History

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);
modelBuilder.Entity("DatabaseImplement.Models.CartItem", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<DateTime>("DateCreated")
.HasColumnType("timestamp without time zone");
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<string>("ProductName")
.IsRequired()
.HasColumnType("text");
b.Property<Guid?>("PurchaseId")
.HasColumnType("uuid");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ProductId");
b.HasIndex("PurchaseId");
b.ToTable("CartItems");
});
2024-06-22 21:16:08 +04:00
modelBuilder.Entity("DatabaseImplement.Models.MediaFile", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
2024-06-25 20:26:34 +04:00
b.Property<byte[]>("Image")
2024-06-22 21:16:08 +04:00
.IsRequired()
2024-06-25 20:26:34 +04:00
.HasColumnType("bytea");
2024-06-22 21:16:08 +04:00
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("ProductId");
2024-06-24 15:06:42 +04:00
b.ToTable("MediaFiles");
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<string>("Category")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
2024-06-22 21:16:08 +04:00
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.Property<Guid?>("SaleId")
.HasColumnType("uuid");
2024-06-22 21:16:08 +04:00
b.HasKey("Id");
b.HasIndex("SaleId");
2024-06-24 15:06:42 +04:00
b.ToTable("Products");
2024-06-22 21:16:08 +04:00
});
modelBuilder.Entity("DatabaseImplement.Models.Purchase", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
2024-06-26 08:04:07 +04:00
b.Property<double>("Cost")
.HasColumnType("double precision");
b.Property<DateTime?>("DateClosed")
.HasColumnType("timestamp without time zone");
b.Property<DateTime>("DateCreated")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
2024-06-22 21:16:08 +04:00
b.Property<bool>("IsPaid")
.HasColumnType("boolean");
b.Property<int>("ProductCount")
.HasColumnType("integer");
2024-06-22 21:16:08 +04:00
b.Property<int>("Status")
.HasColumnType("integer");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
2024-06-22 21:16:08 +04:00
b.HasKey("Id");
b.HasIndex("UserId");
2024-06-24 15:06:42 +04:00
b.ToTable("Purchases");
2024-06-22 21:16:08 +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");
b.ToTable("Roles");
});
modelBuilder.Entity("DatabaseImplement.Models.Sale", b =>
2024-06-04 22:52:01 +04:00
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Category")
.HasColumnType("text");
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("End")
.HasColumnType("timestamp without time zone");
b.Property<string>("FullDescription")
.IsRequired()
.HasColumnType("text");
2024-06-04 22:52:01 +04:00
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<DateTime>("Start")
.HasColumnType("timestamp without time zone");
b.Property<int>("Value")
.HasColumnType("integer");
2024-06-04 22:52:01 +04:00
b.HasKey("Id");
b.ToTable("Sales");
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")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
2024-06-22 21:16:08 +04:00
2024-06-24 15:06:42 +04:00
b.Property<Guid?>("UserId")
.HasColumnType("uuid");
b.HasKey("Id");
b.HasIndex("UserId");
b.ToTable("Sells");
});
modelBuilder.Entity("DatabaseImplement.Models.SellProducts", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("Count")
.HasColumnType("integer");
b.Property<Guid>("ProductId")
.HasColumnType("uuid");
b.Property<Guid>("SellId")
.HasColumnType("uuid");
2024-06-22 21:16:08 +04:00
b.HasKey("Id");
2024-06-24 15:06:42 +04:00
b.HasIndex("ProductId");
b.HasIndex("SellId");
b.ToTable("SellProducts");
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-24 15:06:42 +04:00
b.ToTable("Suppliers");
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-24 15:06:42 +04:00
b.ToTable("SupplierProducts");
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")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
2024-06-22 21:16:08 +04:00
b.Property<DateTime?>("DateArriving")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
b.Property<DateTime?>("DateComplete")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
2024-06-22 21:16:08 +04:00
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-24 15:06:42 +04:00
b.ToTable("Supplies");
});
modelBuilder.Entity("DatabaseImplement.Models.SupplyDoc", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("SupplyId")
.HasColumnType("uuid");
b.HasKey("Id");
b.ToTable("SupplyDocs");
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-24 15:06:42 +04:00
b.ToTable("SupplyProducts");
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")
2024-06-26 08:04:07 +04:00
.HasColumnType("timestamp without time zone");
2024-06-04 22:52:01 +04:00
b.Property<int>("Bonus")
.HasColumnType("integer");
2024-06-04 22:52:01 +04:00
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-24 15:06:42 +04:00
b.ToTable("Users");
2024-06-04 22:52:01 +04:00
});
modelBuilder.Entity("DatabaseImplement.Models.CartItem", b =>
{
b.HasOne("DatabaseImplement.Models.Product", "Product")
.WithMany()
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.Models.Purchase", "Purchase")
.WithMany()
.HasForeignKey("PurchaseId");
b.Navigation("Product");
b.Navigation("Purchase");
});
modelBuilder.Entity("DatabaseImplement.Models.MediaFile", b =>
{
b.HasOne("DatabaseImplement.Models.Product", "Product")
.WithMany()
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Product");
});
modelBuilder.Entity("DatabaseImplement.Models.Product", b =>
{
b.HasOne("DatabaseImplement.Models.Sale", "Sale")
.WithMany("Products")
.HasForeignKey("SaleId");
b.Navigation("Sale");
});
modelBuilder.Entity("DatabaseImplement.Models.Purchase", b =>
{
b.HasOne("DatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("User");
});
2024-06-24 15:06:42 +04:00
modelBuilder.Entity("DatabaseImplement.Models.Sell", b =>
{
b.HasOne("DatabaseImplement.Models.User", "User")
.WithMany()
.HasForeignKey("UserId");
b.Navigation("User");
});
modelBuilder.Entity("DatabaseImplement.Models.SellProducts", b =>
{
b.HasOne("DatabaseImplement.Models.Product", "Product")
.WithMany("SellProducts")
.HasForeignKey("ProductId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("DatabaseImplement.Models.Sell", "Sell")
.WithMany("Products")
.HasForeignKey("SellId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Product");
b.Navigation("Sell");
});
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
modelBuilder.Entity("DatabaseImplement.Models.Product", b =>
{
2024-06-24 15:06:42 +04:00
b.Navigation("SellProducts");
});
modelBuilder.Entity("DatabaseImplement.Models.Sale", b =>
{
b.Navigation("Products");
});
2024-06-24 15:06:42 +04:00
modelBuilder.Entity("DatabaseImplement.Models.Sell", 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
}
}
}