// using System; using DrinkRateAPI.Contexts; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace DrinkRateAPI.Migrations { [DbContext(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.8") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("DbCompanyTableDbCompanyTableView", b => { b.Property("CompanyTablesId") .HasColumnType("uuid"); b.Property("DbCompanyTableViewId") .HasColumnType("uuid"); b.HasKey("CompanyTablesId", "DbCompanyTableViewId"); b.HasIndex("DbCompanyTableViewId"); b.ToTable("DbCompanyTableDbCompanyTableView"); }); modelBuilder.Entity("DbCompanyTableViewDbUser", b => { b.Property("CompanyTableViewsId") .HasColumnType("uuid"); b.Property("UsersId") .HasColumnType("uuid"); b.HasKey("CompanyTableViewsId", "UsersId"); b.HasIndex("UsersId"); b.ToTable("DbCompanyTableViewDbUser"); }); modelBuilder.Entity("DbProductTableDbProductTableView", b => { b.Property("DbProductTableViewId") .HasColumnType("uuid"); b.Property("ProductTablesId") .HasColumnType("uuid"); b.HasKey("DbProductTableViewId", "ProductTablesId"); b.HasIndex("ProductTablesId"); b.ToTable("DbProductTableDbProductTableView"); }); modelBuilder.Entity("DbProductTableViewDbUser", b => { b.Property("ProductTableViewsId") .HasColumnType("uuid"); b.Property("UsersId") .HasColumnType("uuid"); b.HasKey("ProductTableViewsId", "UsersId"); b.HasIndex("UsersId"); b.ToTable("DbProductTableViewDbUser"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompany", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CompanyName") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("CompanyTableId") .HasColumnType("uuid"); b.Property("RatingCount") .HasColumnType("bigint"); b.Property("RatingSum") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("CompanyName") .IsUnique(); b.HasIndex("CompanyTableId"); b.ToTable("Companies"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyRating", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("CompanyId") .HasColumnType("uuid"); b.Property("Comment") .HasColumnType("text"); b.Property("Rating") .HasColumnType("smallint"); b.HasKey("UserId", "CompanyId"); b.HasIndex("CompanyId"); b.ToTable("CompanyRatings"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyTable", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CompanyTableName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("CompanyTableName") .IsUnique(); b.ToTable("CompanyTables"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyTableView", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.HasKey("Id"); b.ToTable("CompanyTableViews"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProduct", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("CompanyId") .HasColumnType("uuid"); b.Property("ProductName") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("ProductTableId") .HasColumnType("uuid"); b.Property("RatingCount") .HasColumnType("bigint"); b.Property("RatingSum") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("CompanyId"); b.HasIndex("ProductName") .IsUnique(); b.HasIndex("ProductTableId"); b.ToTable("Product"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductRating", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("ProductId") .HasColumnType("uuid"); b.Property("Comment") .HasColumnType("text"); b.Property("Rating") .HasColumnType("smallint"); b.HasKey("UserId", "ProductId"); b.HasIndex("ProductId"); b.ToTable("ProductRating"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductTable", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("ProductTableName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("ProductTableName") .IsUnique(); b.ToTable("ProductTable"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductTableView", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.HasKey("Id"); b.ToTable("ProductTableView"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); b.Property("IsAdmin") .HasColumnType("boolean"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("UserName") .IsRequired() .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("UserName") .IsUnique(); b.ToTable("Users"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserCompanyTableStat", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("CompanyTableId") .HasColumnType("uuid"); b.Property("Credits") .HasColumnType("integer"); b.Property("HighestRatingCount") .HasColumnType("integer"); b.Property("RatingCount") .HasColumnType("integer"); b.HasKey("UserId", "CompanyTableId"); b.HasIndex("CompanyTableId"); b.ToTable("UserCompanyTableStats"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProductTableStat", b => { b.Property("UserId") .HasColumnType("uuid"); b.Property("ProductTableId") .HasColumnType("uuid"); b.Property("Credits") .HasColumnType("integer"); b.Property("HighestRatingCount") .HasColumnType("integer"); b.Property("RatingCount") .HasColumnType("integer"); b.HasKey("UserId", "ProductTableId"); b.HasIndex("ProductTableId"); b.ToTable("UserProductTableStats"); }); modelBuilder.Entity("DbCompanyTableDbCompanyTableView", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTable", null) .WithMany() .HasForeignKey("CompanyTablesId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTableView", null) .WithMany() .HasForeignKey("DbCompanyTableViewId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("DbCompanyTableViewDbUser", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTableView", null) .WithMany() .HasForeignKey("CompanyTableViewsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", null) .WithMany() .HasForeignKey("UsersId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("DbProductTableDbProductTableView", b => { b.HasOne("DrinkRateAPI.DbEntities.DbProductTableView", null) .WithMany() .HasForeignKey("DbProductTableViewId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbProductTable", null) .WithMany() .HasForeignKey("ProductTablesId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("DbProductTableViewDbUser", b => { b.HasOne("DrinkRateAPI.DbEntities.DbProductTableView", null) .WithMany() .HasForeignKey("ProductTableViewsId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", null) .WithMany() .HasForeignKey("UsersId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompany", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTable", "CompanyTable") .WithMany("Companies") .HasForeignKey("CompanyTableId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CompanyTable"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyRating", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompany", "Company") .WithMany("CompanyRatings") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", "User") .WithMany("CompanyRatings") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); b.Navigation("User"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProduct", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompany", "Company") .WithMany("Products") .HasForeignKey("CompanyId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbProductTable", "ProductTable") .WithMany("Products") .HasForeignKey("ProductTableId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Company"); b.Navigation("ProductTable"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductRating", b => { b.HasOne("DrinkRateAPI.DbEntities.DbProduct", "Product") .WithMany("ProductRatings") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", "User") .WithMany("ProductRatings") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("Product"); b.Navigation("User"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserCompanyTableStat", b => { b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTable", "CompanyTable") .WithMany() .HasForeignKey("CompanyTableId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", "User") .WithMany("UserCompanyTableStats") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("CompanyTable"); b.Navigation("User"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProductTableStat", b => { b.HasOne("DrinkRateAPI.DbEntities.DbProductTable", "ProductTable") .WithMany() .HasForeignKey("ProductTableId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("DrinkRateAPI.DbEntities.DbUser", "User") .WithMany("UserProductTableStats") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.Navigation("ProductTable"); b.Navigation("User"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompany", b => { b.Navigation("CompanyRatings"); b.Navigation("Products"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyTable", b => { b.Navigation("Companies"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProduct", b => { b.Navigation("ProductRatings"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductTable", b => { b.Navigation("Products"); }); modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUser", b => { b.Navigation("CompanyRatings"); b.Navigation("ProductRatings"); b.Navigation("UserCompanyTableStats"); b.Navigation("UserProductTableStats"); }); #pragma warning restore 612, 618 } } }