diff --git a/CodeLiturgy.Domain/CodeLiturgy.Domain.csproj b/CodeLiturgy.Domain/CodeLiturgy.Domain.csproj
index 61feea5..603775b 100644
--- a/CodeLiturgy.Domain/CodeLiturgy.Domain.csproj
+++ b/CodeLiturgy.Domain/CodeLiturgy.Domain.csproj
@@ -27,6 +27,7 @@
+
diff --git a/CodeLiturgy.Views/StartupExtensions.cs b/CodeLiturgy.Views/StartupExtensions.cs
index 2e9e522..f01d9ed 100644
--- a/CodeLiturgy.Views/StartupExtensions.cs
+++ b/CodeLiturgy.Views/StartupExtensions.cs
@@ -9,6 +9,7 @@ using CodeLiturgy.Views.Utils;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Identity;
+using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
namespace CodeLiturgy.Views;
@@ -147,50 +148,12 @@ public static class StartupExtensions
}
- ///
- /// Get MYSQL Connection String
- ///
- ///
- ///
- ///
- /*
- private static DbContextOptionsBuilder GetMySqlSettings(
- this DbContextOptionsBuilder optionsBuilder,
- IConfiguration configuration,
- IWebHostEnvironment environment)
+ private static DbContextOptionsBuilder UsePsqlConfiguration(this DbContextOptionsBuilder builder, IConfiguration configuration)
{
- var sqlVersion = GetMySqlServerVersion(8, 0, 11);
-
- // Docker / No-Docker
-
-
- var mySqlConnectionString = configuration.GetConnectionString("MySQL");
-
- if (mySqlConnectionString == string.Empty)
- {
- throw new InvalidOperationException("MySQL Connection string appears to be empty.");
- }
-
- optionsBuilder
- .UseMySql(
- mySqlConnectionString,
- sqlVersion)
- .UseMySql(sqlVersion,
- builder => { builder.EnableRetryOnFailure(6, TimeSpan.FromSeconds(3), null); });
-
- // The following three options help with debugging, but should
- // be changed or removed for production.
- if (environment.IsDevelopment())
- {
- optionsBuilder
- .LogTo(Console.WriteLine, LogLevel.Information)
- .EnableSensitiveDataLogging()
- .EnableDetailedErrors();
- }
-
- return optionsBuilder;
+ var connString = configuration.GetConnectionString("database");
+ builder.UseNpgsql(connString);
+ return builder;
}
- */
///
@@ -203,13 +166,11 @@ public static class StartupExtensions
public static IServiceCollection PreparePostgresqlDatabasePool(this IServiceCollection serviceCollection,
IConfiguration configuration, IWebHostEnvironment environment)
{
- return serviceCollection;
- /*.AddDbContextPool(options =>
- options.GetMySqlSettings(configuration, environment))
- .AddDbContextPool(options =>
- options.GetMySqlSettings(configuration, environment))
+ return serviceCollection
+ .AddDbContextPool(options => options.UsePsqlConfiguration(configuration))
+ .AddDbContextPool(options => options.UsePsqlConfiguration(configuration))
.AddDbContextPool(options =>
- options.GetMySqlSettings(configuration, environment));*/
+ options.UsePsqlConfiguration(configuration));
}
diff --git a/CodeLiturgy.Views/appsettings.json b/CodeLiturgy.Views/appsettings.json
index 65cc49f..9987243 100644
--- a/CodeLiturgy.Views/appsettings.json
+++ b/CodeLiturgy.Views/appsettings.json
@@ -8,10 +8,10 @@
"mode": "no-docker",
"AllowedHosts": "*",
"ConnectionStringDocker": {
- "MySQL": "server=db;user=blueuser;password=dXjw127124dJ;database=bluedb;"
+ "database": "Server=127.0.0.1;User Id=clbdlocal;Password=C79J#MV))!YAiy/SzkCf;Database=cldblocal;"
},
"ConnectionStringNoDocker": {
- "MySQL": "server=localhost;user=blueuser;password=dXjw127124dJ;database=bluedb;"
+ "database": "Server=127.0.0.1;User Id=clbdlocal;Password=C79J#MV))!YAiy/SzkCf;Database=cldblocal;"
},
"AuthSettings": {
"SecretKey": "iJWHDmHLpUA283sqsfhqGbMRdRj1PVkH"