public void Run() { Log.Info($"Running Migration Tool ..... "); foreach (var file in _filesLister.GetSqlFilesWithContents()) { var entry = new ReportEntry { File = file.FullPath, StartRunTime = DateTime.Now, Status = "Success" }; try { //check if file has been modified before executing it. if (!_scriptCacheStrategy.HasScriptChanged(file)) { entry.Status = "Skipped"; continue; } Execute(file); _scriptCacheStrategy.CacheScript(file); } catch (Exception ex) { entry.Exception = ex.Message; entry.ReportEntryType = ReportEntryType.Error; entry.Status = "Fail"; } finally { entry.EndRunTime = DateTime.Now; ExecutionReport.AddEntry(entry); } } try { CreateLogViewerFile(); Log.Info("Writing reports....."); ExecutionReport.WriteReport(ReportFileName); Log.Info("Finished running migration tool."); } catch (Exception ex) { throw ex; } }