logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
//if the sql server container is not created on run docker compose this
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//migration can't fail for network related exception. The retry options for DbContext only
logger.LogWarning(exception,"[{prefix}] Exception {ExceptionType} with message {Message} detected on attempt {retry} of {retries}",nameof(TContext),exception.GetType().Name,exception.Message,retry,retries);
});
//if the sql server container is not created on run docker compose this
//migration can't fail for network related exception. The retry options for DbContext only
//apply to transient exceptions
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service)
retry.Execute(()=>InvokeRemover(context));
}
Console.WriteLine("Deleted database associated with context {DbContextName}",typeof(TContext).Name);
logger.LogInformation("Deleted database associated with context {DbContextName}",typeof(TContext).Name);
}
catch(Exceptionex)
{
Console.WriteLine(ex.Message.ToString()+"An error occurred while deleting the database used on context {DbContextName}"+typeof(TContext).Name);
logger.LogError(ex,"An error occurred while deleting the database used on context {DbContextName}",typeof(TContext).Name);
if(underK8s)
{
throw;// Rethrow under k8s because we rely on k8s to re-run the pod