コード例 #1
0
        public void DeleteDatabase(string dbName, string connStringWithoutCatalog, DatabaseType dbType)
        {
            DatabaseHandler db1    = new DatabaseHandler(connStringWithoutCatalog, dbType);
            MsSqlDeploy     deploy = new MsSqlDeploy();

            if (deploy.CheckDatabaseExists(db1.Database, dbName))
            {
                deploy.DeleteDatabase(db1.Database, dbName);
            }
        }
コード例 #2
0
        public void DeployDatabase(TestNodes mainTestNode, string connectionString, string dbName, string connStringWithoutCatalog, DatabaseType dbType, string pathToScript)
        {
            Logger.Info("Deploying database.");

            Logger.Debug($"Deploying database {dbName}. Deployed script path: {pathToScript}.");

            DatabaseHandler db     = new DatabaseHandler(connectionString, dbType);
            DatabaseHandler db1    = new DatabaseHandler(connStringWithoutCatalog, dbType);
            MsSqlDeploy     deploy = new MsSqlDeploy();

            if (!deploy.CheckDatabaseExists(db1.Database, dbName))
            {
                deploy.CreateDatabase(db1.Database, dbName);
            }
            deploy.DeployScript(pathToScript, mainTestNode, db);

            Logger.Info("Deployed successful.");
        }