Fix forgotten renaming of user, change applicationuser id type to guid

This commit is contained in:
martinshoob 2025-08-09 17:57:41 +02:00
parent d2e156b9f1
commit e7ce2c7718
9 changed files with 88 additions and 93 deletions

View file

@ -1,10 +1,11 @@
using DrinkRateAPI.DbEntities; using DrinkRateAPI.DbEntities;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
namespace DrinkRateAPI.Contexts; namespace DrinkRateAPI.Contexts;
public class ApplicationDbContext : IdentityDbContext<DbApplicationUser> public class ApplicationDbContext : IdentityDbContext<DbApplicationUser, IdentityRole<Guid>, Guid>
{ {
public DbSet<DbCompany> Companies { get; set; } public DbSet<DbCompany> Companies { get; set; }
public DbSet<DbCompanyRating> CompanyRatings { get; set; } public DbSet<DbCompanyRating> CompanyRatings { get; set; }
@ -180,11 +181,11 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
entity.HasMany(up => up.UserProfileCompanyTableStats) entity.HasMany(up => up.UserProfileCompanyTableStats)
.WithOne(upcts => upcts.UserProfile) .WithOne(upcts => upcts.UserProfile)
.HasForeignKey(upcts => upcts.UserId); .HasForeignKey(upcts => upcts.UserProfileId);
entity.HasMany(up => up.UserProfileProductTableStats) entity.HasMany(up => up.UserProfileProductTableStats)
.WithOne(uppts => uppts.UserProfile) .WithOne(uppts => uppts.UserProfile)
.HasForeignKey(uppts => uppts.UserId); .HasForeignKey(uppts => uppts.UserProfileId);
entity.HasIndex(up => up.UserName) entity.HasIndex(up => up.UserName)
.IsUnique(); .IsUnique();
@ -197,7 +198,7 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
// User Company Table Stat // User Company Table Stat
modelBuilder.Entity<DbUserProfileCompanyTableStat>(entity => 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) entity.HasOne(upcts => upcts.UserProfile)
.WithMany(up => up.UserProfileCompanyTableStats); .WithMany(up => up.UserProfileCompanyTableStats);
@ -209,7 +210,7 @@ public class ApplicationDbContext : IdentityDbContext<DbApplicationUser>
// User Product Table Stat // User Product Table Stat
modelBuilder.Entity<DbUserProfileProductTableStat>(entity => 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) entity.HasOne(uppts => uppts.UserProfile)
.WithMany(up => up.UserProfileProductTableStats); .WithMany(up => up.UserProfileProductTableStats);

View file

@ -2,7 +2,7 @@ using Microsoft.AspNetCore.Identity;
namespace DrinkRateAPI.DbEntities; namespace DrinkRateAPI.DbEntities;
public class DbApplicationUser : IdentityUser public class DbApplicationUser : IdentityUser<Guid>
{ {
public virtual DbUserProfile UserProfile { get; set; } public virtual DbUserProfile UserProfile { get; set; }
} }

View file

@ -21,7 +21,7 @@ public class DbUserProfile
public bool IsDeleted { get; set; } public bool IsDeleted { get; set; }
public string ApplicationUserId { get; set; } public Guid ApplicationUserId { get; set; }
public virtual DbApplicationUser ApplicationUser { get; set; } public virtual DbApplicationUser ApplicationUser { get; set; }
} }

View file

@ -2,7 +2,7 @@ namespace DrinkRateAPI.DbEntities;
public class DbUserProfileCompanyTableStat public class DbUserProfileCompanyTableStat
{ {
public Guid UserId { get; set; } public Guid UserProfileId { get; set; }
public DbUserProfile UserProfile { get; set; } public DbUserProfile UserProfile { get; set; }
public Guid CompanyTableId { get; set; } public Guid CompanyTableId { get; set; }

View file

@ -2,7 +2,7 @@ namespace DrinkRateAPI.DbEntities;
public class DbUserProfileProductTableStat public class DbUserProfileProductTableStat
{ {
public Guid UserId { get; set; } public Guid UserProfileId { get; set; }
public DbUserProfile UserProfile { get; set; } public DbUserProfile UserProfile { get; set; }
public Guid ProductTableId { get; set; } public Guid ProductTableId { get; set; }

View file

@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DrinkRateAPI.Migrations namespace DrinkRateAPI.Migrations
{ {
[DbContext(typeof(ApplicationDbContext))] [DbContext(typeof(ApplicationDbContext))]
[Migration("20250809145003_init")] [Migration("20250809154816_ChangeApplicationUserIdType")]
partial class init partial class ChangeApplicationUserIdType
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -87,8 +87,9 @@ namespace DrinkRateAPI.Migrations
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b => modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
{ {
b.Property<string>("Id") b.Property<Guid>("Id")
.HasColumnType("text"); .ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AccessFailedCount") b.Property<int>("AccessFailedCount")
.HasColumnType("integer"); .HasColumnType("integer");
@ -320,9 +321,8 @@ namespace DrinkRateAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uuid"); .HasColumnType("uuid");
b.Property<string>("ApplicationUserId") b.Property<Guid>("ApplicationUserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.Property<bool>("IsAdmin") b.Property<bool>("IsAdmin")
.HasColumnType("boolean"); .HasColumnType("boolean");
@ -393,10 +393,11 @@ namespace DrinkRateAPI.Migrations
b.ToTable("UserProfileProductTableStats"); b.ToTable("UserProfileProductTableStats");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
{ {
b.Property<string>("Id") b.Property<Guid>("Id")
.HasColumnType("text"); .ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
@ -419,7 +420,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetRoles", (string)null); 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") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -433,9 +434,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("RoleId") b.Property<Guid>("RoleId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@ -444,7 +444,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetRoleClaims", (string)null); 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") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -458,9 +458,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("UserId") b.Property<Guid>("UserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@ -469,7 +468,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserClaims", (string)null); 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") b.Property<string>("LoginProvider")
.HasColumnType("text"); .HasColumnType("text");
@ -480,9 +479,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("UserId") b.Property<Guid>("UserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
@ -491,13 +489,13 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserLogins", (string)null); 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") b.Property<Guid>("UserId")
.HasColumnType("text"); .HasColumnType("uuid");
b.Property<string>("RoleId") b.Property<Guid>("RoleId")
.HasColumnType("text"); .HasColumnType("uuid");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
@ -506,10 +504,10 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserRoles", (string)null); 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") b.Property<Guid>("UserId")
.HasColumnType("text"); .HasColumnType("uuid");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasColumnType("text"); .HasColumnType("text");
@ -702,16 +700,16 @@ namespace DrinkRateAPI.Migrations
b.Navigation("UserProfile"); 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() .WithMany()
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()
@ -720,7 +718,7 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()
@ -729,9 +727,9 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .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() .WithMany()
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
@ -744,7 +742,7 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()

View file

@ -7,7 +7,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace DrinkRateAPI.Migrations namespace DrinkRateAPI.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class init : Migration public partial class ChangeApplicationUserIdType : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -16,7 +16,7 @@ namespace DrinkRateAPI.Migrations
name: "AspNetRoles", name: "AspNetRoles",
columns: table => new 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), Name = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = 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) ConcurrencyStamp = table.Column<string>(type: "text", nullable: true)
@ -30,7 +30,7 @@ namespace DrinkRateAPI.Migrations
name: "AspNetUsers", name: "AspNetUsers",
columns: table => new 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), UserName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = 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), 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) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .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), ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = 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) Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), .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), ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = 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), LoginProvider = table.Column<string>(type: "text", nullable: false),
ProviderKey = table.Column<string>(type: "text", nullable: false), ProviderKey = table.Column<string>(type: "text", nullable: false),
ProviderDisplayName = table.Column<string>(type: "text", nullable: true), 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 => constraints: table =>
{ {
@ -163,8 +163,8 @@ namespace DrinkRateAPI.Migrations
name: "AspNetUserRoles", name: "AspNetUserRoles",
columns: table => new columns: table => new
{ {
UserId = table.Column<string>(type: "text", nullable: false), UserId = table.Column<Guid>(type: "uuid", nullable: false),
RoleId = table.Column<string>(type: "text", nullable: false) RoleId = table.Column<Guid>(type: "uuid", nullable: false)
}, },
constraints: table => constraints: table =>
{ {
@ -187,7 +187,7 @@ namespace DrinkRateAPI.Migrations
name: "AspNetUserTokens", name: "AspNetUserTokens",
columns: table => new 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), LoginProvider = table.Column<string>(type: "text", nullable: false),
Name = table.Column<string>(type: "text", nullable: false), Name = table.Column<string>(type: "text", nullable: false),
Value = table.Column<string>(type: "text", nullable: true) Value = table.Column<string>(type: "text", nullable: true)
@ -211,7 +211,7 @@ namespace DrinkRateAPI.Migrations
UserName = table.Column<string>(type: "text", nullable: false), UserName = table.Column<string>(type: "text", nullable: false),
IsAdmin = table.Column<bool>(type: "boolean", nullable: false), IsAdmin = table.Column<bool>(type: "boolean", nullable: false),
IsDeleted = 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 => constraints: table =>
{ {

View file

@ -84,8 +84,9 @@ namespace DrinkRateAPI.Migrations
modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b => modelBuilder.Entity("DrinkRateAPI.DbEntities.DbApplicationUser", b =>
{ {
b.Property<string>("Id") b.Property<Guid>("Id")
.HasColumnType("text"); .ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<int>("AccessFailedCount") b.Property<int>("AccessFailedCount")
.HasColumnType("integer"); .HasColumnType("integer");
@ -317,9 +318,8 @@ namespace DrinkRateAPI.Migrations
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
.HasColumnType("uuid"); .HasColumnType("uuid");
b.Property<string>("ApplicationUserId") b.Property<Guid>("ApplicationUserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.Property<bool>("IsAdmin") b.Property<bool>("IsAdmin")
.HasColumnType("boolean"); .HasColumnType("boolean");
@ -390,10 +390,11 @@ namespace DrinkRateAPI.Migrations
b.ToTable("UserProfileProductTableStats"); b.ToTable("UserProfileProductTableStats");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole<System.Guid>", b =>
{ {
b.Property<string>("Id") b.Property<Guid>("Id")
.HasColumnType("text"); .ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp") b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken() .IsConcurrencyToken()
@ -416,7 +417,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetRoles", (string)null); 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") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -430,9 +431,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("RoleId") b.Property<Guid>("RoleId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@ -441,7 +441,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetRoleClaims", (string)null); 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") b.Property<int>("Id")
.ValueGeneratedOnAdd() .ValueGeneratedOnAdd()
@ -455,9 +455,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ClaimValue") b.Property<string>("ClaimValue")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("UserId") b.Property<Guid>("UserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("Id"); b.HasKey("Id");
@ -466,7 +465,7 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserClaims", (string)null); 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") b.Property<string>("LoginProvider")
.HasColumnType("text"); .HasColumnType("text");
@ -477,9 +476,8 @@ namespace DrinkRateAPI.Migrations
b.Property<string>("ProviderDisplayName") b.Property<string>("ProviderDisplayName")
.HasColumnType("text"); .HasColumnType("text");
b.Property<string>("UserId") b.Property<Guid>("UserId")
.IsRequired() .HasColumnType("uuid");
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey"); b.HasKey("LoginProvider", "ProviderKey");
@ -488,13 +486,13 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserLogins", (string)null); 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") b.Property<Guid>("UserId")
.HasColumnType("text"); .HasColumnType("uuid");
b.Property<string>("RoleId") b.Property<Guid>("RoleId")
.HasColumnType("text"); .HasColumnType("uuid");
b.HasKey("UserId", "RoleId"); b.HasKey("UserId", "RoleId");
@ -503,10 +501,10 @@ namespace DrinkRateAPI.Migrations
b.ToTable("AspNetUserRoles", (string)null); 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") b.Property<Guid>("UserId")
.HasColumnType("text"); .HasColumnType("uuid");
b.Property<string>("LoginProvider") b.Property<string>("LoginProvider")
.HasColumnType("text"); .HasColumnType("text");
@ -699,16 +697,16 @@ namespace DrinkRateAPI.Migrations
b.Navigation("UserProfile"); 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() .WithMany()
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()
@ -717,7 +715,7 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()
@ -726,9 +724,9 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .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() .WithMany()
.HasForeignKey("RoleId") .HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
@ -741,7 +739,7 @@ namespace DrinkRateAPI.Migrations
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
{ {
b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null) b.HasOne("DrinkRateAPI.DbEntities.DbApplicationUser", null)
.WithMany() .WithMany()

View file

@ -1,7 +1,5 @@
using DrinkRateAPI.Contexts; using DrinkRateAPI.Contexts;
using DrinkRateAPI.DbEntities; using DrinkRateAPI.DbEntities;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);