Establishes a link between DbUserProfile and DbApplicationUser, allowing for better management of user-related information and integration with ASP.NET Identity. Renames DbUser to DbUserProfile and updates related entities and configurations.
602 lines
21 KiB
C#
602 lines
21 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using DrinkRateAPI.Contexts;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace DrinkRateAPI.Migrations
|
|
{
|
|
[DbContext(typeof(ApplicationDbContext))]
|
|
[Migration("20250809134029_Init")]
|
|
partial class Init
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(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<Guid>("CompanyTablesId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("DbCompanyTableViewId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("CompanyTablesId", "DbCompanyTableViewId");
|
|
|
|
b.HasIndex("DbCompanyTableViewId");
|
|
|
|
b.ToTable("DbCompanyTableDbCompanyTableView");
|
|
});
|
|
|
|
modelBuilder.Entity("DbCompanyTableViewDbUserProfile", b =>
|
|
{
|
|
b.Property<Guid>("CompanyTableViewsId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("UserProfilesId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("CompanyTableViewsId", "UserProfilesId");
|
|
|
|
b.HasIndex("UserProfilesId");
|
|
|
|
b.ToTable("DbCompanyTableViewDbUserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("DbProductTableDbProductTableView", b =>
|
|
{
|
|
b.Property<Guid>("DbProductTableViewId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ProductTablesId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("DbProductTableViewId", "ProductTablesId");
|
|
|
|
b.HasIndex("ProductTablesId");
|
|
|
|
b.ToTable("DbProductTableDbProductTableView");
|
|
});
|
|
|
|
modelBuilder.Entity("DbProductTableViewDbUserProfile", b =>
|
|
{
|
|
b.Property<Guid>("ProductTableViewsId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("UserProfilesId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("ProductTableViewsId", "UserProfilesId");
|
|
|
|
b.HasIndex("UserProfilesId");
|
|
|
|
b.ToTable("DbProductTableViewDbUserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
|
|
{
|
|
b.Property<string>("Id")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<int>("AccessFailedCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("ConcurrencyStamp")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("EmailConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("LockoutEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("NormalizedEmail")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("NormalizedUserName")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<string>("PhoneNumber")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("PhoneNumberConfirmed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("SecurityStamp")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("TwoFactorEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("UserName")
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ApplicationUsers");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompany", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("CompanyName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<Guid>("CompanyTableId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<long>("RatingCount")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("RatingSum")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyName")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("CompanyTableId");
|
|
|
|
b.ToTable("Companies");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyRating", b =>
|
|
{
|
|
b.Property<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CompanyId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Comment")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<byte>("Rating")
|
|
.HasColumnType("smallint");
|
|
|
|
b.HasKey("UserProfileId", "CompanyId");
|
|
|
|
b.HasIndex("CompanyId");
|
|
|
|
b.ToTable("CompanyRatings");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyTable", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("CompanyTableName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CompanyTableName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("CompanyTables");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbCompanyTableView", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("CompanyTableViews");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProduct", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CompanyId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ProductName")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<Guid>("ProductTableId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<long>("RatingCount")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("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<Guid>("UserProfileId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ProductId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Comment")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<byte>("Rating")
|
|
.HasColumnType("smallint");
|
|
|
|
b.HasKey("UserProfileId", "ProductId");
|
|
|
|
b.HasIndex("ProductId");
|
|
|
|
b.ToTable("ProductRating");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductTable", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ProductTableName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ProductTableName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("ProductTable");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbProductTableView", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("ProductTableView");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfile", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ApplicationUserId")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<bool>("IsAdmin")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("UserName")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ApplicationUserId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserName")
|
|
.IsUnique();
|
|
|
|
b.ToTable("UserProfiles");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfileCompanyTableStat", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("CompanyTableId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("Credits")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("HighestRatingCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RatingCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("UserId", "CompanyTableId");
|
|
|
|
b.HasIndex("CompanyTableId");
|
|
|
|
b.ToTable("UserProfileCompanyTableStats");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfileProductTableStat", b =>
|
|
{
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("ProductTableId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("Credits")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("HighestRatingCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("RatingCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("UserId", "ProductTableId");
|
|
|
|
b.HasIndex("ProductTableId");
|
|
|
|
b.ToTable("UserProfileProductTableStats");
|
|
});
|
|
|
|
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("DbCompanyTableViewDbUserProfile", b =>
|
|
{
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTableView", null)
|
|
.WithMany()
|
|
.HasForeignKey("CompanyTableViewsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbUserProfile", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserProfilesId")
|
|
.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("DbProductTableViewDbUserProfile", b =>
|
|
{
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbProductTableView", null)
|
|
.WithMany()
|
|
.HasForeignKey("ProductTableViewsId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbUserProfile", null)
|
|
.WithMany()
|
|
.HasForeignKey("UserProfilesId")
|
|
.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.DbUserProfile", "UserProfile")
|
|
.WithMany("CompanyRatings")
|
|
.HasForeignKey("UserProfileId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Company");
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
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.DbUserProfile", "UserProfile")
|
|
.WithMany("ProductRatings")
|
|
.HasForeignKey("UserProfileId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Product");
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfile", b =>
|
|
{
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", "ApplicationUser")
|
|
.WithOne("UserProfile")
|
|
.HasForeignKey("DrinkRateAPI.DbEntities.DbUserProfile", "ApplicationUserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ApplicationUser");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfileCompanyTableStat", b =>
|
|
{
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbCompanyTable", "CompanyTable")
|
|
.WithMany()
|
|
.HasForeignKey("CompanyTableId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbUserProfile", "UserProfile")
|
|
.WithMany("UserProfileCompanyTableStats")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("CompanyTable");
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbUserProfileProductTableStat", b =>
|
|
{
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbProductTable", "ProductTable")
|
|
.WithMany()
|
|
.HasForeignKey("ProductTableId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("DrinkRateAPI.DbEntities.DbUserProfile", "UserProfile")
|
|
.WithMany("UserProfileProductTableStats")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("ProductTable");
|
|
|
|
b.Navigation("UserProfile");
|
|
});
|
|
|
|
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
|
|
{
|
|
b.Navigation("UserProfile")
|
|
.IsRequired();
|
|
});
|
|
|
|
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.DbUserProfile", b =>
|
|
{
|
|
b.Navigation("CompanyRatings");
|
|
|
|
b.Navigation("ProductRatings");
|
|
|
|
b.Navigation("UserProfileCompanyTableStats");
|
|
|
|
b.Navigation("UserProfileProductTableStats");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|