update on production db
This commit is contained in:
@@ -36,8 +36,14 @@ builder.Services.AddControllers()
|
||||
// commands (`dotnet ef migrations add`) and startup depend on the database being reachable.
|
||||
// MariaDbServerVersion — not MySqlServerVersion — because the target is MariaDB 10.11, and
|
||||
// Pomelo changes its SQL translation based on which it is given.
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection")
|
||||
?? throw new InvalidOperationException("ConnectionStrings:DefaultConnection is not configured.");
|
||||
// IsNullOrWhiteSpace, not just null: appsettings.json ships the key with an empty value so the
|
||||
// shape is self-documenting, and each environment supplies the real one. A blank must fail here
|
||||
// with this message rather than reaching UseMySql, which would report an opaque parse error.
|
||||
var connectionString = builder.Configuration.GetConnectionString("DefaultConnection");
|
||||
if (string.IsNullOrWhiteSpace(connectionString))
|
||||
throw new InvalidOperationException(
|
||||
"ConnectionStrings:DefaultConnection is not configured. Set it in appsettings.<Environment>.json "
|
||||
+ "or as the ConnectionStrings__DefaultConnection environment variable.");
|
||||
|
||||
builder.Services.AddDbContext<ErpDbContext>(o =>
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
}
|
||||
},
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Host=localhost;Port=5432;Database=ERPCoreTest;Username=postgres;Password=post@hexdive"
|
||||
"DefaultConnection": "server=localhost;port=3306;database=erpcore;user=poojathmi;password=poojathmi@hexdive.com"
|
||||
},
|
||||
"Urls": "http://0.0.0.0:6701",
|
||||
"Auth": {
|
||||
|
||||
Reference in New Issue
Block a user