Skip to content

Commit

Permalink
Merge pull request #1412 from NuGet/tilovell-FixDatabaseInheritedMemb…
Browse files Browse the repository at this point in the history
…erWarnings

Fix warnings: DatabaseName' hides inherited member 'NuGetGallery.Operati...
  • Loading branch information
Tim Lovell-Smith committed Aug 26, 2013
2 parents 45ff8a4 + 6fd6a82 commit c2c08e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 25 deletions.
Expand Up @@ -84,9 +84,11 @@ public override void ExecuteCommand()
Log.Info("Exporting '{0}'...", dailyBackup.DatabaseName);
(new ExportDatabaseTask()
{
ConnectionString = ConnectionString,
ConnectionString = new SqlConnectionStringBuilder(ConnectionString.ConnectionString)
{
InitialCatalog = dailyBackup.DatabaseName
},
DestinationStorage = StorageAccount,
DatabaseName = dailyBackup.DatabaseName,
DestinationContainer = "database-backups",
SqlDacEndpoint = SqlDacEndpoint,
WhatIf = WhatIf
Expand Down
Expand Up @@ -68,9 +68,11 @@ public override void ExecuteCommand()
Log.Info("Exporting '{0}'...", dailyBackup.DatabaseName);
(new ExportDatabaseTask()
{
ConnectionString = ConnectionString,
ConnectionString = new SqlConnectionStringBuilder(ConnectionString.ConnectionString)
{
InitialCatalog = dailyBackup.DatabaseName
},
DestinationStorage = StorageAccount,
DatabaseName = dailyBackup.DatabaseName,
DestinationContainer = "warehouse-backups",
SqlDacEndpoint = SqlDacEndpoint,
WhatIf = WhatIf
Expand Down
7 changes: 0 additions & 7 deletions src/NuGetGallery.Operations/Tasks/ExportDatabaseTask.cs
Expand Up @@ -24,9 +24,6 @@ public class ExportDatabaseTask : DatabaseTask
[Option("Blob container in which the backup should be placed", AltName = "c")]
public string DestinationContainer { get; set; }

[Option("The name of the database to export (if not specified, the one in the connection string will be used)", AltName = "dbname")]
public string DatabaseName { get; set; }

[Option("URL of the SQL DAC endpoint to talk to", AltName = "dac")]
public Uri SqlDacEndpoint { get; set; }

Expand All @@ -53,10 +50,6 @@ public override void ValidateArguments()

public override void ExecuteCommand()
{
if (!String.IsNullOrEmpty(DatabaseName))
{
ConnectionString.InitialCatalog = DatabaseName;
}
Log.Info("Exporting {0} on {1} to {2}", ConnectionString.InitialCatalog, Util.GetDatabaseServerName(ConnectionString), DestinationStorage.Credentials.AccountName);

string serverName = ConnectionString.DataSource;
Expand Down
13 changes: 0 additions & 13 deletions src/NuGetGallery.Operations/Tasks/SanitizeDatabaseTask.cs
Expand Up @@ -29,9 +29,6 @@ UPDATE Users
"Export_" // Only exports can be sanitized
};

[Option("The database name on the server to santize if different from the database identified in the connection string", AltName = "d")]
public string DatabaseName { get; set; }

[Option("Domain name to use for sanitized email addresses, username@[emaildomain]", AltName = "e")]
public string EmailDomain { get; set; }

Expand All @@ -48,16 +45,6 @@ public override void ValidateArguments()

public override void ExecuteCommand()
{
// Coalesce the database name
DatabaseName = String.IsNullOrEmpty(DatabaseName) ?
ConnectionString.InitialCatalog :
DatabaseName;

ConnectionString = new SqlConnectionStringBuilder(ConnectionString.ConnectionString)
{
InitialCatalog = DatabaseName
};

// Verify the name
if (!Force && !AllowedPrefixes.Any(p => ConnectionString.InitialCatalog.StartsWith(p)))
{
Expand Down
1 change: 0 additions & 1 deletion src/NuGetGallery.Operations/Tasks/TaskBases.cs
Expand Up @@ -65,7 +65,6 @@ public abstract class DatabaseTaskBase : OpsTask
public SqlConnectionStringBuilder ConnectionString { get; set; }

protected string ServerName { get { return Util.GetDatabaseServerName(ConnectionString); } }
protected string DatabaseName { get { return ConnectionString.InitialCatalog; } }

public override void ValidateArguments()
{
Expand Down

0 comments on commit c2c08e1

Please sign in to comment.