feat(dir-data): enable sensitive data logging in migration Action

This commit is contained in:
Collin Barrett 2024-06-17 10:45:36 -05:00
parent 7ccad6930b
commit 0e344805ba
2 changed files with 6 additions and 1 deletions

View file

@ -82,6 +82,8 @@ jobs:
-p FilterLists.Directory.Infrastructure.Migrations
-s FilterLists.Directory.Api
working-directory: ./services/Directory
env:
DOTNET_RUNNING_EF_CORE_TOOLS: true
- name: Commit Effective Migration
run: |

View file

@ -19,7 +19,10 @@ public static void AddInfrastructure(this IHostApplicationBuilder builder)
// retry on Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 0 - Undefined error: 0)
so.EnableRetryOnFailure([0])
.MigrationsAssembly(MigrationsAssembly))
.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking));
.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking)
.EnableSensitiveDataLogging(string.Equals(
Environment.GetEnvironmentVariable("DOTNET_RUNNING_EF_CORE_TOOLS"), "true",
StringComparison.OrdinalIgnoreCase)));
builder.Services.AddHostedService<MigrationService>();
builder.Services.AddMemoryCache();
}