Setup base EF model and authentication #1
9 changed files with 88 additions and 93 deletions
|
@ -1,10 +1,11 @@
|
|||
using DrinkRateAPI.DbEntities;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DrinkRateAPI.Contexts;
|
||||
|
||||
public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
||||
public class ApplicationDbContext : IdentityDbContext<DbApplicationUser, IdentityRole<Guid>, Guid>
|
||||
{
|
||||
public DbSet<DbCompany> Companies { get; set; }
|
||||
public DbSet<DbCompanyRating> CompanyRatings { get; set; }
|
||||
|
@ -180,11 +181,11 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
|||
|
||||
entity.HasMany(up => up.UserProfileCompanyTableStats)
|
||||
.WithOne(upcts => upcts.UserProfile)
|
||||
.HasForeignKey(upcts => upcts.UserId);
|
||||
.HasForeignKey(upcts => upcts.UserProfileId);
|
||||
|
||||
entity.HasMany(up => up.UserProfileProductTableStats)
|
||||
.WithOne(uppts => uppts.UserProfile)
|
||||
.HasForeignKey(uppts => uppts.UserId);
|
||||
.HasForeignKey(uppts => uppts.UserProfileId);
|
||||
|
||||
entity.HasIndex(up => up.UserName)
|
||||
.IsUnique();
|
||||
|
@ -197,7 +198,7 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
|||
// User Company Table Stat
|
||||
modelBuilder.Entity<DbUserProfileCompanyTableStat>(entity =>
|
||||
{
|
||||
entity.HasKey(upcts => new { upcts.UserId, upcts.CompanyTableId });
|
||||
entity.HasKey(upcts => new { UserId = upcts.UserProfileId, upcts.CompanyTableId });
|
||||
|
||||
entity.HasOne(upcts => upcts.UserProfile)
|
||||
.WithMany(up => up.UserProfileCompanyTableStats);
|
||||
|
@ -209,7 +210,7 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
|
|||
// User Product Table Stat
|
||||
modelBuilder.Entity<DbUserProfileProductTableStat>(entity =>
|
||||
{
|
||||
entity.HasKey(uppts => new { uppts.UserId, uppts.ProductTableId });
|
||||
entity.HasKey(uppts => new { UserId = uppts.UserProfileId, uppts.ProductTableId });
|
||||
|
||||
entity.HasOne(uppts => uppts.UserProfile)
|
||||
.WithMany(up => up.UserProfileProductTableStats);
|
||||
|
|
|
@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Identity;
|
|||
|
||||
namespace DrinkRateAPI.DbEntities;
|
||||
|
||||
public class DbApplicationUser : IdentityUser
|
||||
public class DbApplicationUser : IdentityUser<Guid>
|
||||
{
|
||||
public virtual DbUserProfile UserProfile { get; set; }
|
||||
}
|
|
@ -21,7 +21,7 @@ public class DbUserProfile
|
|||
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public string ApplicationUserId { get; set; }
|
||||
public Guid ApplicationUserId { get; set; }
|
||||
|
||||
public virtual DbApplicationUser ApplicationUser { get; set; }
|
||||
}
|
|
@ -2,7 +2,7 @@ namespace DrinkRateAPI.DbEntities;
|
|||
|
||||
public class DbUserProfileCompanyTableStat
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
public DbUserProfile UserProfile { get; set; }
|
||||
|
||||
public Guid CompanyTableId { get; set; }
|
||||
|
|
|
@ -2,7 +2,7 @@ namespace DrinkRateAPI.DbEntities;
|
|||
|
||||
public class DbUserProfileProductTableStat
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public Guid UserProfileId { get; set; }
|
||||
public DbUserProfile UserProfile { get; set; }
|
||||
|
||||
public Guid ProductTableId { get; set; }
|
||||
|
|
|
@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace DrinkRateAPI.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20250809145003_init")]
|
||||
partial class init
|
||||
[Migration("20250809154816_ChangeApplicationUserIdType")]
|
||||
partial class ChangeApplicationUserIdType
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
|
@ -87,8 +87,9 @@ namespace DrinkRateAPI.Migrations
|
|||
|
||||
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
@ -320,9 +321,8 @@ namespace DrinkRateAPI.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("boolean");
|
||||
|
@ -393,10 +393,11 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("UserProfileProductTableStats");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
|
@ -419,7 +420,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
@ -433,9 +434,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
@ -444,7 +444,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
@ -458,9 +458,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
@ -469,7 +468,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
@ -480,9 +479,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
|
@ -491,13 +489,13 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
|
@ -506,10 +504,10 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
@ -702,16 +700,16 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Navigation("UserProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
||||
|
@ -720,7 +718,7 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
||||
|
@ -729,9 +727,9 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|
@ -744,7 +742,7 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
|
@ -7,7 +7,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||
namespace DrinkRateAPI.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class init : Migration
|
||||
public partial class ChangeApplicationUserIdType : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
|
@ -16,7 +16,7 @@ namespace DrinkRateAPI.Migrations
|
|||
name: "AspNetRoles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "text", nullable: false),
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
|
||||
|
@ -30,7 +30,7 @@ namespace DrinkRateAPI.Migrations
|
|||
name: "AspNetUsers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "text", nullable: false),
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
NormalizedUserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
Email = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
|
||||
|
@ -103,7 +103,7 @@ namespace DrinkRateAPI.Migrations
|
|||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
RoleId = table.Column<string>(type: "text", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
|
@ -124,7 +124,7 @@ namespace DrinkRateAPI.Migrations
|
|||
{
|
||||
Id = table.Column<int>(type: "integer", nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
UserId = table.Column<string>(type: "text", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
ClaimType = table.Column<string>(type: "text", nullable: true),
|
||||
ClaimValue = table.Column<string>(type: "text", nullable: true)
|
||||
},
|
||||
|
@ -146,7 +146,7 @@ namespace DrinkRateAPI.Migrations
|
|||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderKey = table.Column<string>(type: "text", nullable: false),
|
||||
ProviderDisplayName = table.Column<string>(type: "text", nullable: true),
|
||||
UserId = table.Column<string>(type: "text", nullable: false)
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
@ -163,8 +163,8 @@ namespace DrinkRateAPI.Migrations
|
|||
name: "AspNetUserRoles",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<string>(type: "text", nullable: false),
|
||||
RoleId = table.Column<string>(type: "text", nullable: false)
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
RoleId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ namespace DrinkRateAPI.Migrations
|
|||
name: "AspNetUserTokens",
|
||||
columns: table => new
|
||||
{
|
||||
UserId = table.Column<string>(type: "text", nullable: false),
|
||||
UserId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LoginProvider = table.Column<string>(type: "text", nullable: false),
|
||||
Name = table.Column<string>(type: "text", nullable: false),
|
||||
Value = table.Column<string>(type: "text", nullable: true)
|
||||
|
@ -211,7 +211,7 @@ namespace DrinkRateAPI.Migrations
|
|||
UserName = table.Column<string>(type: "text", nullable: false),
|
||||
IsAdmin = table.Column<bool>(type: "boolean", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "boolean", nullable: false),
|
||||
ApplicationUserId = table.Column<string>(type: "text", nullable: false)
|
||||
ApplicationUserId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
|
@ -84,8 +84,9 @@ namespace DrinkRateAPI.Migrations
|
|||
|
||||
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<int>("AccessFailedCount")
|
||||
.HasColumnType("integer");
|
||||
|
@ -317,9 +318,8 @@ namespace DrinkRateAPI.Migrations
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ApplicationUserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("ApplicationUserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<bool>("IsAdmin")
|
||||
.HasColumnType("boolean");
|
||||
|
@ -390,10 +390,11 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("UserProfileProductTableStats");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken()
|
||||
|
@ -416,7 +417,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
@ -430,9 +431,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
@ -441,7 +441,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetRoleClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
|
@ -455,9 +455,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ClaimValue")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
@ -466,7 +465,7 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserClaims", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
@ -477,9 +476,8 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Property<string>("ProviderDisplayName")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
|
@ -488,13 +486,13 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserLogins", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("RoleId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
|
@ -503,10 +501,10 @@ namespace DrinkRateAPI.Migrations
|
|||
b.ToTable("AspNetUserRoles", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.Property<string>("UserId")
|
||||
.HasColumnType("text");
|
||||
b.Property<Guid>("UserId")
|
||||
.HasColumnType("uuid");
|
||||
|
||||
b.Property<string>("LoginProvider")
|
||||
.HasColumnType("text");
|
||||
|
@ -699,16 +697,16 @@ namespace DrinkRateAPI.Migrations
|
|||
b.Navigation("UserProfile");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
||||
|
@ -717,7 +715,7 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
||||
|
@ -726,9 +724,9 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
|
||||
b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
|
@ -741,7 +739,7 @@ namespace DrinkRateAPI.Migrations
|
|||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
|
||||
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||
{
|
||||
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
|
||||
.WithMany()
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using DrinkRateAPI.Contexts;
|
||||
using DrinkRateAPI.DbEntities;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
|
Loading…
Reference in a new issue