asimeonov/DbUp.Downgrade

Ability to utilize DbUp GenerateUpgradeHtmlReport

clouddna-au opened this issue · 2 comments

Describe the bug
Would it be possible to utilize the DbUp GenerateUpgradeHtmlReport within DbUp.Downgrade

To Reproduce
Steps to reproduce the behavior:

  1. What is the DbUp.Downgrade version that you are using? 2.1.0
  2. What is the DbUp Script Provider that you are using? 4.5.0
  3. What is the issue that you have? Dont have ability to generate GenerateUpgradeHtmlReport

Expected behavior
Ability like DbUp to generate report of scripts executed

Hey, I had a look over GenerateUpgradeHtmlReport functionality in DbUp. It is newly introduced in 4.5.0 and I have missed it. In general it shows what scripts will be executed. In order to generate similar functionality there should be clear separation of the files for update and downgrade. DbUp is not always welcome to extensions in some aspects of the code and HtmlReport is one of them. I'm aiming to create another extension that will get both update and downgrade file paths and generate 2 reports based on the operation output. Will need around a week to prepare the solution and publish a new version.

Cheers

@clouddna-au I have noticed that in the bug you want to use only the DbUp GenerateUpgradeHtmlReport ability? This can be done without any updates from my side. After you create the downgrade engine var upgrader = upgradeEngineBuilder.BuildWithDowngrade(true); you can access the internal DbUp UpgradeEngine with upgrader.UpgradeEngine.GenerateUpgradeHtmlReport("C:\\DeploymentLocation\\UpgradeReport.html");

This will only generate report of scripts executed but not the one that are downgraded. I'm still working on the possibility to add this into the library.

var upgrader = upgradeEngineBuilder.BuildWithDowngrade(true);
upgrader.UpgradeEngine.GenerateUpgradeHtmlReport("pathForReportGeneration");
var result = upgrader.PerformUpgrade();

Can you please check and confirm that I clearly understand what is the issue and does the suggested solution works for you?

Cheers