diff --git a/.gitignore b/.gitignore index 9491a2f..f4337a6 100644 --- a/.gitignore +++ b/.gitignore @@ -360,4 +360,7 @@ MigrationBackup/ .ionide/ # Fody - auto-generated XML schema -FodyWeavers.xsd \ No newline at end of file +FodyWeavers.xsd + +# Don't push database credentials stored in appsettings.json! +*/appsettings.json \ No newline at end of file diff --git a/WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/WebApp/Migrations/20250408112459_InitialDataStore.Designer.cs similarity index 64% rename from WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs rename to WebApp/Migrations/20250408112459_InitialDataStore.Designer.cs index e92c981..448dbaf 100644 --- a/WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs +++ b/WebApp/Migrations/20250408112459_InitialDataStore.Designer.cs @@ -1,224 +1,228 @@ -// +// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using WebApp.Data; -namespace WebApp.Data.Migrations +#nullable disable + +namespace WebApp.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("00000000000000_CreateIdentitySchema")] - partial class CreateIdentitySchema + [Migration("20250408112459_InitialDataStore")] + partial class InitialDataStore { + /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); + .HasDatabaseName("RoleNameIndex"); - b.ToTable("AspNetRoles"); + b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("RoleId"); - b.ToTable("AspNetRoleClaims"); + b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("AccessFailedCount") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); + .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); + .HasDatabaseName("UserNameIndex"); - b.ToTable("AspNetUsers"); + b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("UserId"); - b.ToTable("AspNetUserClaims"); + b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); - b.ToTable("AspNetUserLogins"); + b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("RoleId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); - b.ToTable("AspNetUserRoles"); + b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("Value") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); - b.ToTable("AspNetUserTokens"); + b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => diff --git a/WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/WebApp/Migrations/20250408112459_InitialDataStore.cs similarity index 60% rename from WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs rename to WebApp/Migrations/20250408112459_InitialDataStore.cs index b8bb73f..73f3c55 100644 --- a/WebApp/Data/Migrations/00000000000000_CreateIdentitySchema.cs +++ b/WebApp/Migrations/20250408112459_InitialDataStore.cs @@ -1,21 +1,25 @@ using System; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; -namespace WebApp.Data.Migrations +#nullable disable + +namespace WebApp.Migrations { - public partial class CreateIdentitySchema : Migration + /// + public partial class InitialDataStore : Migration { + /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AspNetRoles", columns: table => new { - Id = table.Column(nullable: false), - Name = table.Column(maxLength: 256, nullable: true), - NormalizedName = table.Column(maxLength: 256, nullable: true), - ConcurrencyStamp = table.Column(nullable: true) + Id = table.Column(type: "text", nullable: false), + Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true) }, constraints: table => { @@ -26,21 +30,21 @@ namespace WebApp.Data.Migrations name: "AspNetUsers", columns: table => new { - Id = table.Column(nullable: false), - UserName = table.Column(maxLength: 256, nullable: true), - NormalizedUserName = table.Column(maxLength: 256, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - EmailConfirmed = table.Column(nullable: false), - PasswordHash = table.Column(nullable: true), - SecurityStamp = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - TwoFactorEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - LockoutEnabled = table.Column(nullable: false), - AccessFailedCount = table.Column(nullable: false) + Id = table.Column(type: "text", nullable: false), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true), + EmailConfirmed = table.Column(type: "boolean", nullable: false), + PasswordHash = table.Column(type: "text", nullable: true), + SecurityStamp = table.Column(type: "text", nullable: true), + ConcurrencyStamp = table.Column(type: "text", nullable: true), + PhoneNumber = table.Column(type: "text", nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false), + TwoFactorEnabled = table.Column(type: "boolean", nullable: false), + LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true), + LockoutEnabled = table.Column(type: "boolean", nullable: false), + AccessFailedCount = table.Column(type: "integer", nullable: false) }, constraints: table => { @@ -51,11 +55,11 @@ namespace WebApp.Data.Migrations name: "AspNetRoleClaims", columns: table => new { - Id = table.Column(nullable: false) - .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - RoleId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true) + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RoleId = table.Column(type: "text", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) }, constraints: table => { @@ -72,11 +76,11 @@ namespace WebApp.Data.Migrations name: "AspNetUserClaims", columns: table => new { - Id = table.Column(nullable: false) - .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn), - UserId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(nullable: true) + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: false), + ClaimType = table.Column(type: "text", nullable: true), + ClaimValue = table.Column(type: "text", nullable: true) }, constraints: table => { @@ -93,10 +97,10 @@ namespace WebApp.Data.Migrations name: "AspNetUserLogins", columns: table => new { - LoginProvider = table.Column(maxLength: 128, nullable: false), - ProviderKey = table.Column(maxLength: 128, nullable: false), - ProviderDisplayName = table.Column(nullable: true), - UserId = table.Column(nullable: false) + LoginProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderKey = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + ProviderDisplayName = table.Column(type: "text", nullable: true), + UserId = table.Column(type: "text", nullable: false) }, constraints: table => { @@ -113,8 +117,8 @@ namespace WebApp.Data.Migrations name: "AspNetUserRoles", columns: table => new { - UserId = table.Column(nullable: false), - RoleId = table.Column(nullable: false) + UserId = table.Column(type: "text", nullable: false), + RoleId = table.Column(type: "text", nullable: false) }, constraints: table => { @@ -137,10 +141,10 @@ namespace WebApp.Data.Migrations name: "AspNetUserTokens", columns: table => new { - UserId = table.Column(nullable: false), - LoginProvider = table.Column(maxLength: 128, nullable: false), - Name = table.Column(maxLength: 128, nullable: false), - Value = table.Column(nullable: true) + UserId = table.Column(type: "text", nullable: false), + LoginProvider = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, nullable: false), + Value = table.Column(type: "text", nullable: true) }, constraints: table => { @@ -162,8 +166,7 @@ namespace WebApp.Data.Migrations name: "RoleNameIndex", table: "AspNetRoles", column: "NormalizedName", - unique: true, - filter: "[NormalizedName] IS NOT NULL"); + unique: true); migrationBuilder.CreateIndex( name: "IX_AspNetUserClaims_UserId", @@ -189,10 +192,10 @@ namespace WebApp.Data.Migrations name: "UserNameIndex", table: "AspNetUsers", column: "NormalizedUserName", - unique: true, - filter: "[NormalizedUserName] IS NOT NULL"); + unique: true); } + /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( diff --git a/WebApp/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs similarity index 65% rename from WebApp/Data/Migrations/ApplicationDbContextModelSnapshot.cs rename to WebApp/Migrations/ApplicationDbContextModelSnapshot.cs index ba33ac2..bfff3af 100644 --- a/WebApp/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/WebApp/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,12 +1,14 @@ -// +// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using WebApp.Data; -namespace WebApp.Data.Migrations +#nullable disable + +namespace WebApp.Migrations { [DbContext(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot @@ -15,208 +17,209 @@ namespace WebApp.Data.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.0.0") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("ProductVersion", "9.0.3") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); + .HasDatabaseName("RoleNameIndex"); - b.ToTable("AspNetRoles"); + b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("RoleId"); - b.ToTable("AspNetRoleClaims"); + b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("AccessFailedCount") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); + .HasMaxLength(256) + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); + .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); + .HasDatabaseName("UserNameIndex"); - b.ToTable("AspNetUsers"); + b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("UserId"); - b.ToTable("AspNetUserClaims"); + b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); - b.ToTable("AspNetUserLogins"); + b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("RoleId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); - b.ToTable("AspNetUserRoles"); + b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); + .HasMaxLength(128) + .HasColumnType("character varying(128)"); b.Property("Value") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); - b.ToTable("AspNetUserTokens"); + b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => diff --git a/WebApp/Program.cs b/WebApp/Program.cs index 23f12d8..acdb487 100644 --- a/WebApp/Program.cs +++ b/WebApp/Program.cs @@ -7,7 +7,7 @@ var builder = WebApplication.CreateBuilder(args); // Add services to the container. var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found."); builder.Services.AddDbContext(options => - options.UseSqlServer(connectionString)); + options.UseNpgsql(connectionString)); builder.Services.AddDatabaseDeveloperPageExceptionFilter(); builder.Services.AddDefaultIdentity(options => options.SignIn.RequireConfirmedAccount = true) diff --git a/WebApp/WebApp.csproj b/WebApp/WebApp.csproj index 3886d3d..42a2d12 100644 --- a/WebApp/WebApp.csproj +++ b/WebApp/WebApp.csproj @@ -1,18 +1,28 @@ - + - net8.0 + net9.0 enable enable aspnet-WebApp-718c04e4-1a0c-4a69-ab9c-4db84c77bab1 - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/WebApp/appsettings.json b/WebApp/appsettings.json deleted file mode 100644 index eec8951..0000000 --- a/WebApp/appsettings.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "ConnectionStrings": { - "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-WebApp-718c04e4-1a0c-4a69-ab9c-4db84c77bab1;Trusted_Connection=True;MultipleActiveResultSets=true" - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Warning" - } - }, - "AllowedHosts": "*" -}