Skip to content

Commit

Permalink
[SQL] Add breaking change warning (#14673)
Browse files Browse the repository at this point in the history
* add breaking change warning

* Update breaking change warning to target cmdlet output

* Update changelog to show breaking change warnings added

* "upcoming release"

Co-authored-by: Dingmeng Xue <[email protected]>
  • Loading branch information
xaliciayang and dingmeng-xue authored Apr 8, 2021
1 parent 5c65060 commit 4822f6b
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Sql/Sql/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@
- Additional information about change #1
-->
## Upcoming Release
* Added cmdlet output breaking change warnings to the following:
- `New-AzSqlDatabase`
- `Get-AzSqlDatabase`
- `Set-AzSqlDatabase`
- `Remove-AzSqlDatabase`
- `New-AzSqlDatabaseSecondary`
- `Remove-AzSqlDatabaseSecondary`
- `Get-AzSqlDatabaseReplicationLink`
- `New-AzSqlDatabaseCopy`
- `Set-AzSqlDatabaseSecondary`


## Version 2.17.0
* Added cmdlet `New-AzSqlServerTrustGroup`
Expand Down
7 changes: 7 additions & 0 deletions src/Sql/Sql/Database/Cmdlet/GetAzureSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Sql.Database.Model;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Sql.Database.Cmdlet
{
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureSqlDatabaseModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabase", SupportsShouldProcess = true,ConfirmImpact = ConfirmImpact.None)]
[OutputType(typeof(AzureSqlDatabaseModel))]
public class GetAzureSqlDatabase : AzureSqlDatabaseCmdletBase<IEnumerable<AzureSqlDatabaseModel>>
Expand Down
6 changes: 6 additions & 0 deletions src/Sql/Sql/Database/Cmdlet/NewAzureSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@
using System.Management.Automation;
using System.Collections;
using System.Globalization;
using System;

namespace Microsoft.Azure.Commands.Sql.Database.Cmdlet
{
/// <summary>
/// Cmdlet to create a new Azure Sql Database
/// </summary>
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureSqlDatabaseModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabase", SupportsShouldProcess = true,ConfirmImpact = ConfirmImpact.Low, DefaultParameterSetName = DtuDatabaseParameterSet), OutputType(typeof(AzureSqlDatabaseModel))]
public class NewAzureSqlDatabase : AzureSqlDatabaseCmdletBase<AzureSqlDatabaseCreateOrUpdateModel>
{
Expand Down
7 changes: 7 additions & 0 deletions src/Sql/Sql/Database/Cmdlet/RemoveAzureSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,19 @@

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Sql.Database.Model;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Sql.Database.Cmdlet
{
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureSqlDatabaseModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabase", SupportsShouldProcess = true), OutputType(typeof(AzureSqlDatabaseModel))]
public class RemoveAzureSqlDatabase : AzureSqlDatabaseCmdletBase<IEnumerable<AzureSqlDatabaseModel>>
{
Expand Down
5 changes: 5 additions & 0 deletions src/Sql/Sql/Database/Cmdlet/SetAzureSqlDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ namespace Microsoft.Azure.Commands.Sql.Database.Cmdlet
/// <summary>
/// Cmdlet to create a new Azure Sql Database
/// </summary>
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureSqlDatabaseModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabase", SupportsShouldProcess = true,ConfirmImpact = ConfirmImpact.Medium, DefaultParameterSetName = UpdateParameterSetName), OutputType(typeof(AzureSqlDatabaseModel))]
public class SetAzureSqlDatabase : AzureSqlDatabaseCmdletBase<IEnumerable<AzureSqlDatabaseModel>>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Sql.Replication.Model;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
{
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureReplicationLinkModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabaseReplicationLink", ConfirmImpact = ConfirmImpact.None, SupportsShouldProcess = true)]
[OutputType(typeof(AzureReplicationLinkModel))]
public class GetAzureSqlDatabaseReplicationLink : AzureSqlDatabaseSecondaryCmdletBase
Expand Down
7 changes: 7 additions & 0 deletions src/Sql/Sql/Replication/Cmdlet/NewAzureSqlDatabaseCopy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
using System.Linq;
using System.Management.Automation;
using System.Globalization;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;

namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
{
/// <summary>
/// Cmdlet to create a new Azure SQL Database Copy
/// </summary>
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureSqlDatabaseCopyModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabaseCopy", ConfirmImpact = ConfirmImpact.Low, SupportsShouldProcess = true, DefaultParameterSetName = DtuDatabaseParameterSet), OutputType(typeof(AzureSqlDatabaseCopyModel))]
public class NewAzureSqlDatabaseCopy : AzureSqlDatabaseCopyCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,19 @@
using System.Linq;
using System.Management.Automation;
using System.Globalization;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;

namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
{
/// <summary>
/// Cmdlet to create a new Azure SQL Database Secondary and Replication Link
/// </summary>
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureReplicationLinkModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabaseSecondary",ConfirmImpact = ConfirmImpact.Low, SupportsShouldProcess = true, DefaultParameterSetName = DtuDatabaseParameterSet), OutputType(typeof(AzureReplicationLinkModel))]
public class NewAzureSqlDatabaseSecondary : AzureSqlDatabaseSecondaryCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@

using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Sql.Replication.Model;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Management.Automation;

namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
{
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureReplicationLinkModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabaseSecondary", SupportsShouldProcess = true), OutputType(typeof(AzureReplicationLinkModel))]
public class RemoveAzureSqlDatabaseSecondary : AzureSqlDatabaseSecondaryCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Commands.Sql.Properties;
using Microsoft.Azure.Commands.Sql.Replication.Model;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Management.Automation;

Expand All @@ -23,6 +25,11 @@ namespace Microsoft.Azure.Commands.Sql.Replication.Cmdlet
/// <summary>
/// Cmdlet to fail over Azure SQL Database Replication Link to the secondary database
/// </summary>
[CmdletOutputBreakingChange(
deprecatedCmdletOutputTypeName: typeof(AzureReplicationLinkModel),
deprecateByVersion: "3.0.0",
DeprecatedOutputProperties = new String[] { "BackupStorageRedundancy" },
NewOutputProperties = new String[] { "CurrentBackupStorageRedundancy", "RequestedBackupStorageRedundancy" })]
[Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SqlDatabaseSecondary",DefaultParameterSetName = NoOptionsSet,ConfirmImpact = ConfirmImpact.Medium, SupportsShouldProcess = true), OutputType(typeof(AzureReplicationLinkModel))]
public class SetAzureSqlDatabaseSecondary : AzureSqlDatabaseSecondaryCmdletBase
{
Expand Down

0 comments on commit 4822f6b

Please sign in to comment.