diff --git a/.github/workflows/directory-migrate.yml b/.github/workflows/directory-migrate.yml index ac2adf46b..2d14d41ad 100644 --- a/.github/workflows/directory-migrate.yml +++ b/.github/workflows/directory-migrate.yml @@ -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: | diff --git a/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs b/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs index a3f86d2f3..d93eeec3c 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/ConfigurationExtensions.cs @@ -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(); builder.Services.AddMemoryCache(); }