Migration vers postgres #7

Merged
mcmuzzle merged 1 commits from 4_BranchementPostgres into main 2024-09-06 18:55:29 +00:00
12 changed files with 220 additions and 132 deletions

3
.gitignore vendored
View File

@@ -17,3 +17,6 @@ obj
report
tools/
TestResults
#docker data
/docker-dev/data

View File

@@ -0,0 +1,23 @@
=== Prérequis
* DotNet 8
* Docker (26.0.2 minimum recommandé)
* Docker Compose (2.26.1 minimum recommandé)
=== Cloner le dépot
=== Lancer les containers
[,sh]
----
docker compose -f .\docker-dev\compose.yml -p ludik-zone up -d
----
=== Migrer la bdd
Lors de la migration de la BDD, les données de connections seront celles du *appsettings.Development.json*
[,sh]
----
dotnet ef database update --project .\src\LudikZoneBlazor\LudikZoneBlazor.csproj
----

View File

@@ -1 +1,26 @@
Hello world
= Ludik zone documentation (DEX)
:source-highlighter: pygments
:source-language: bash
:doctype: book
:source-highlighter: rouge
:toc: macro
:toc-title: Table des matières
toc::[]
== Présentation
Le projet Ludik zone est un projet open source ayant comme objectif de créer un portait hébergeant différent jeux en tour par tour.
== Instalation du poste de dev
include::documentation_technique/installation-poste.adoc[]
== Architecture du projet
include::documentation_technique/architecture-projet.adoc[]
== Developpement et livraison
include::documentation_technique/developpement-livraison.adoc[]

Binary file not shown.

View File

@@ -15,10 +15,10 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.*" />
<PackageReference Include="MudBlazor" Version="7.*" />
<PackageReference Include="Extensions.MudBlazor.StaticInput" Version="2.*" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.*" />
</ItemGroup>
</Project>

View File

@@ -1,76 +1,81 @@
// <auto-generated />
// <auto-generated />
using System;
using LudikZoneBlazor.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace LudikZoneBlazor.Migrations
{
[DbContext(typeof(ApplicationDbContext))]
[Migration("00000000000000_CreateIdentitySchema")]
partial class CreateIdentitySchema
[Migration("20240906111336_Init")]
partial class Init
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("LudikZoneBlazor.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.HasKey("Id");
@@ -87,19 +92,19 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.HasKey("Id");
@@ -114,17 +119,19 @@ namespace LudikZoneBlazor.Migrations
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("Id");
@@ -137,17 +144,19 @@ namespace LudikZoneBlazor.Migrations
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("Id");
@@ -159,17 +168,17 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
@@ -181,10 +190,10 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
@@ -196,16 +205,16 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");

View File

@@ -1,12 +1,13 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace LudikZoneBlazor.Migrations
{
/// <inheritdoc />
public partial class CreateIdentitySchema : Migration
public partial class Init : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
@@ -15,10 +16,10 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetRoles",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true)
Id = table.Column<string>(type: "text", 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)
},
constraints: table =>
{
@@ -29,21 +30,21 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetUsers",
columns: table => new
{
Id = table.Column<string>(type: "TEXT", nullable: false),
UserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedUserName = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
Email = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
NormalizedEmail = table.Column<string>(type: "TEXT", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
PasswordHash = table.Column<string>(type: "TEXT", nullable: true),
SecurityStamp = table.Column<string>(type: "TEXT", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumber = table.Column<string>(type: "TEXT", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "INTEGER", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "TEXT", nullable: true),
LockoutEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
AccessFailedCount = table.Column<int>(type: "INTEGER", nullable: false)
Id = table.Column<string>(type: "text", 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),
NormalizedEmail = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column<bool>(type: "boolean", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: true),
SecurityStamp = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "text", nullable: true),
PhoneNumber = table.Column<string>(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column<bool>(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column<bool>(type: "boolean", nullable: false),
LockoutEnd = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column<bool>(type: "boolean", nullable: false),
AccessFailedCount = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
@@ -54,11 +55,11 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
RoleId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column<string>(type: "text", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
@@ -75,11 +76,11 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column<int>(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
UserId = table.Column<string>(type: "TEXT", nullable: false),
ClaimType = table.Column<string>(type: "TEXT", nullable: true),
ClaimValue = table.Column<string>(type: "TEXT", nullable: true)
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column<string>(type: "text", nullable: false),
ClaimType = table.Column<string>(type: "text", nullable: true),
ClaimValue = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
@@ -96,10 +97,10 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetUserLogins",
columns: table => new
{
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)
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)
},
constraints: table =>
{
@@ -116,8 +117,8 @@ namespace LudikZoneBlazor.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<string>(type: "text", nullable: false),
RoleId = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
@@ -140,10 +141,10 @@ namespace LudikZoneBlazor.Migrations
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column<string>(type: "TEXT", 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)
UserId = table.Column<string>(type: "text", 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)
},
constraints: table =>
{

View File

@@ -1,9 +1,10 @@
// <auto-generated />
// <auto-generated />
using System;
using LudikZoneBlazor.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
@@ -15,59 +16,63 @@ namespace LudikZoneBlazor.Migrations
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
modelBuilder
.HasAnnotation("ProductVersion", "8.0.8")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("LudikZoneBlazor.Data.ApplicationUser", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<int>("AccessFailedCount")
.HasColumnType("INTEGER");
.HasColumnType("integer");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Email")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<bool>("EmailConfirmed")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<bool>("LockoutEnabled")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("LockoutEnd")
.HasColumnType("TEXT");
.HasColumnType("timestamp with time zone");
b.Property<string>("NormalizedEmail")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedUserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("PasswordHash")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("PhoneNumber")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<bool>("PhoneNumberConfirmed")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<string>("SecurityStamp")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<bool>("TwoFactorEnabled")
.HasColumnType("INTEGER");
.HasColumnType("boolean");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.HasKey("Id");
@@ -84,19 +89,19 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.Property<string>("NormalizedName")
.HasMaxLength(256)
.HasColumnType("TEXT");
.HasColumnType("character varying(256)");
b.HasKey("Id");
@@ -111,17 +116,19 @@ namespace LudikZoneBlazor.Migrations
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("RoleId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("Id");
@@ -134,17 +141,19 @@ namespace LudikZoneBlazor.Migrations
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INTEGER");
.HasColumnType("integer");
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
b.Property<string>("ClaimType")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ClaimValue")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("Id");
@@ -156,17 +165,17 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
{
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ProviderKey")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("ProviderDisplayName")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("UserId")
.IsRequired()
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("LoginProvider", "ProviderKey");
@@ -178,10 +187,10 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("UserId", "RoleId");
@@ -193,16 +202,16 @@ namespace LudikZoneBlazor.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
{
b.Property<string>("UserId")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("LoginProvider")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Name")
.HasColumnType("TEXT");
.HasColumnType("text");
b.Property<string>("Value")
.HasColumnType("TEXT");
.HasColumnType("text");
b.HasKey("UserId", "LoginProvider", "Name");

View File

@@ -5,6 +5,7 @@ using MudBlazor.Services;
using LudikZoneBlazor.Components;
using LudikZoneBlazor.Components.Account;
using LudikZoneBlazor.Data;
using Npgsql;
var builder = WebApplication.CreateBuilder(args);
@@ -27,11 +28,20 @@ builder.Services.AddAuthentication(options =>
})
.AddIdentityCookies();
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection") ?? throw new InvalidOperationException("Connection string 'DefaultConnection' not found.");
#region Base de données
NpgsqlConnectionStringBuilder conStrBuilder = new NpgsqlConnectionStringBuilder(builder.Configuration.GetConnectionString("DefaultConnection"));
conStrBuilder.Host = string.IsNullOrEmpty(builder.Configuration["DB_HOST"]) ? conStrBuilder.Host : builder.Configuration["DB_HOST"];
conStrBuilder.Username = string.IsNullOrEmpty(builder.Configuration["DB_USER"]) ? conStrBuilder.Username : builder.Configuration["DB_USER"];
conStrBuilder.Database = string.IsNullOrEmpty(builder.Configuration["DB_DATABASE"]) ? conStrBuilder.Database : builder.Configuration["DB_DATABASE"];
conStrBuilder.Port = int.TryParse(builder.Configuration["DB_PORT"], out int tempVal) ? tempVal : conStrBuilder.Port;
conStrBuilder.Password = builder.Configuration["DB_PASSWORD"];
builder.Services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlite(connectionString));
options.UseNpgsql(conStrBuilder.ToString()));
builder.Services.AddDatabaseDeveloperPageExceptionFilter();
#endregion
builder.Services.AddIdentityCore<ApplicationUser>(options => options.SignIn.RequireConfirmedAccount = true)
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddSignInManager()

View File

@@ -1,8 +1,16 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"DefaultConnection": "host=localhost;username=admin;database=ludikZone;Pooling=false;Timeout=300;CommandTimeout=300;Port=5432;"
},
"DB_HOST": "localhost",
"DB_PORT": 5432,
"DB_USER": "admin",
"DB_PASSWORD": "admin",
"DB_DATABASE": "ludikZone"
}