/// <summary>
        /// This method will generate an HTML report which can be uploaded as an artifact to any deployment / build tool which supports artifacts.  Useful for getting approvals and seeing a history of what ran when
        /// </summary>
        /// <param name="upgradeEngine">The upgrade engine</param>
        /// <param name="fullPath">The full path of the file which will be generated</param>
        /// <param name="serverName">The name of the server being connected to</param>
        /// <param name="databaseName">The name of the database being upgraded</param>
        public static void GenerateUpgradeHtmlReport(this IUpgradeEngine upgradeEngine, string fullPath, string serverName, string databaseName)
        {
            var scriptsToRunList = upgradeEngine.GetScriptsToExecute();
            var htmlReport = new StringBuilder();

            htmlReport.Append(GetHtmlHeader(serverName, databaseName));

            for (var i = 0; i < scriptsToRunList.Count; i++)
            {
                htmlReport.Append(GetHtmlForScript(scriptsToRunList[i], i));
            }

            htmlReport.Append(GetHtmlFooter());

            if (File.Exists(fullPath))
            {
                File.Delete(fullPath);
            }

            File.WriteAllText(fullPath, htmlReport.ToString(), DbUpDefaults.DefaultEncoding);
        }
Exemple #2
0
        public static int Main()
        {
            IUpgradeEngine upgradeEngine = UpgradeEngineFactory.Create();

            return(upgradeEngine.PerformUpgrade().Result);
        }
Exemple #3
0
        public static int Main()
        {
            IUpgradeEngine upgradeEngine = UpgradeEngineFactory.Create(UpgradeEngineFactory.DatabaseType.PostgreSql);

            return(upgradeEngine.PerformUpgrade().Result);
        }
 /// <summary>
 /// This method will generate an HTML report which can be uploaded as an artifact to any deployment / build tool which supports artifacts.  Useful for getting approvals and seeing a history of what ran when
 /// </summary>
 /// <param name="upgradeEngine">The upgrade engine</param>
 /// <param name="fullPath">The full path of the file which will be generated</param>
 public static void GenerateUpgradeHtmlReport(this IUpgradeEngine upgradeEngine, string fullPath)
 {
     GenerateUpgradeHtmlReport(upgradeEngine, fullPath, string.Empty, string.Empty);
 }