/// <summary> /// Updates the database. /// </summary> /// <param name="name">The name.</param> /// <returns>Result of updating the database</returns> public SqlDeployResult UpdateDatabase(string name) { if (this._security != null && !this._security.IsAllowed()) { return GetIsNotAllowedUpgradeResult(); } var databaseToUpdate = this._settings.Databases.Single(d => d.DatabaseName.Equals(name, StringComparison.OrdinalIgnoreCase)); var updater = new SqlDeployUpdater(databaseToUpdate); updater.UpdateProgress += (sender, e) => { if (this.UpdateProgress != null) { UpdateProgress(this, e); } }; return updater.Execute().Single(); }
/// <summary> /// Updates the databases. /// </summary> /// <returns>Result of each database update</returns> public IEnumerable<SqlDeployResult> UpdateDatabases() { if (this._security != null && !this._security.IsAllowed()) { return new List<SqlDeployResult> { GetIsNotAllowedUpgradeResult() }; } var updater = new SqlDeployUpdater(this.Settings.Databases); updater.UpdateProgress += (sender, e) => { if (this.UpdateProgress != null) { UpdateProgress(this, e); } }; return updater.Execute(true); }
/// <summary> /// Updates the database. /// </summary> /// <param name="name">The name.</param> /// <returns>Result of updating the database</returns> public SqlDeployResult UpdateDatabase(string name) { if (this._security != null && !this._security.IsAllowed()) { return(GetIsNotAllowedUpgradeResult()); } var databaseToUpdate = this._settings.Databases.Single(d => d.DatabaseName.Equals(name, StringComparison.OrdinalIgnoreCase)); var updater = new SqlDeployUpdater(databaseToUpdate); updater.UpdateProgress += (sender, e) => { if (this.UpdateProgress != null) { UpdateProgress(this, e); } }; return(updater.Execute().Single()); }
/// <summary> /// Updates the databases. /// </summary> /// <returns>Result of each database update</returns> public IEnumerable <SqlDeployResult> UpdateDatabases() { if (this._security != null && !this._security.IsAllowed()) { return(new List <SqlDeployResult> { GetIsNotAllowedUpgradeResult() }); } var updater = new SqlDeployUpdater(this.Settings.Databases); updater.UpdateProgress += (sender, e) => { if (this.UpdateProgress != null) { UpdateProgress(this, e); } }; return(updater.Execute(true)); }