Skip to content

Commit

Permalink
BREAKING CHANGE: SqlServerDsc: Removed resource SqlDatabaseRecoveryMo…
Browse files Browse the repository at this point in the history
…del (#1541)

- SqlDatabaseRecoveryModel
  - This resource is now deprecated. The functionality is now covered by
    a property in the resource SqlDatabase (issue #967).
  • Loading branch information
johlju authored May 12, 2020
1 parent 554302d commit 7b0ba90
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 373 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ in a future release.
the resources _SqlServerProtocol_ and _SqlServerProtocolTcpIp_.
- SqlDatabaseOwner
- This resource is now deprecated. The functionality is now covered by
the resources _SqlDatabase_ ([issue #966](https://github.com/dsccommunity/SqlServerDsc/issues/966)).
a property in the resource _SqlDatabase_ ([issue #966](https://github.com/dsccommunity/SqlServerDsc/issues/966)).
- SqlDatabaseRecoveryModel
- This resource is now deprecated. The functionality is now covered by
a property in the resource _SqlDatabase_ ([issue #967](https://github.com/dsccommunity/SqlServerDsc/issues/967)).

### Added

Expand Down Expand Up @@ -75,6 +78,9 @@ in a future release.
- BREAKING CHANGE: The parameter `ServerName` is now non-mandatory and
defaults to `$env:COMPUTERNAME` ([issue #319](https://github.com/dsccommunity/SqlServerDsc/issues/319)).
- Normalize parameter descriptive text for default values.
- SqlDatabaseOwner
- BREAKING CHANGE: Database changed to DatabaseName for consistency with
other modules ([issue #1484](https://github.com/dsccommunity/SqlServerDsc/issues/1484)).
- SqlDatabasePermission
- BREAKING CHANGE: The parameter `ServerName` is now non-mandatory and
defaults to `$env:COMPUTERNAME` ([issue #319](https://github.com/dsccommunity/SqlServerDsc/issues/319)).
Expand Down
40 changes: 7 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ for these deprecated resources. These resources will be removed
in a future release.

* SqlDatabaseOwner _(replaced by a property in [**SqlDatabase**](#sqldatabase)_.
* SqlDatabaseRecoveryModel _(replaced by a property in [**SqlDatabase**](#sqldatabase)_.
* SqlServerNetwork _(replaced by [**SqlServerProtocol**](#sqlserverprotocol) and_
_[**SqlServerProtocolTcpIp**](#sqlserverprotocoltcpip))_.

Expand Down Expand Up @@ -100,8 +101,6 @@ in a future release.
to manage default locations for Data, Logs, and Backups for SQL Server
* [**SqlDatabasePermission**](#sqldatabasepermission) resource to
manage SQL database permissions.
* [**SqlDatabaseRecoveryModel**](#sqldatabaserecoverymodel) resource
to manage database recovery model.
* [**SqlDatabaseRole**](#sqldatabaserole) resource to manage SQL database roles.
* [**SqlDatabaseUser**](#sqldatabaseuser) resource to manage SQL database users.
* [**SqlRS**](#sqlrs) configures SQL Server Reporting.
Expand Down Expand Up @@ -586,6 +585,12 @@ This resource is used to create or delete a database. For more information about
SQL Server databases, please read the following articles [Create a Database](https://docs.microsoft.com/en-us/sql/relational-databases/databases/create-a-database)
and [Delete a Database](https://docs.microsoft.com/en-us/sql/relational-databases/databases/delete-a-database).

This resource set the recovery model for a database. The recovery model controls
how transactions are logged, whether the transaction log requires (and allows)
backing up, and what kinds of restore operations are available. Three recovery
models exist: full, simple, and bulk-logged. Read more about recovery model in
the article [View or Change the Recovery Model of a Database](https://msdn.microsoft.com/en-us/library/ms189272.aspx).

#### Requirements

* Target machine must be running Windows Server 2008 R2 or later.
Expand Down Expand Up @@ -704,37 +709,6 @@ will also get their permission revoked.

All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/SqlServerDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SqlDatabasePermission).

### SqlDatabaseRecoveryModel

This resource set the recovery model for a database. The recovery model controls
how transactions are logged, whether the transaction log requires (and allows)
backing up, and what kinds of restore operations are available.
Three recovery models exist: full, simple, and bulk-logged.
Read more about recovery model in this article
[View or Change the Recovery Model of a Database](https://msdn.microsoft.com/en-us/library/ms189272.aspx)

#### Requirements

* Target machine must be running Windows Server 2008 R2 or later.
* Target machine must be running SQL Server Database Engine 2008 or later.

#### Parameters

* **`[String]` Name** _(Key)_: The SQL database name.
* **`[String]` InstanceName** _(Key)_: The name of the SQL instance to be configured.
* **`[String]` RecoveryModel** _(Required)_: The recovery model to use for the database.
{ Full | Simple | BulkLogged }.
* **`[String]` ServerName** _(Write)_: The host name of the SQL Server to be configured.
Default value is `$env:COMPUTERNAME`.

#### Examples

* [Set the RecoveryModel of a database](/source/Examples/Resources/SqlDatabaseRecoveryModel/1-SetDatabaseRecoveryModel.ps1)

#### Known issues

All issues are not listed here, see [here for all open issues](https://github.com/dsccommunity/SqlServerDsc/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+SqlDatabaseRecoveryModel).

### SqlDatabaseRole

This resource is used to create a database role when Ensure is set to 'Present'
Expand Down
3 changes: 3 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Pester:
# Deprecated resources
- source/DSCResources/MSFT_SqlServerNetwork
- source/DSCResources/MSFT_SqlDatabaseOwner
- source/DSCResources/MSFT_SqlDatabaseRecoveryModel
Script:
- tests/Unit
ExcludeTag:
Expand All @@ -79,11 +80,13 @@ DscTest:
# Deprecated resources
- source/DSCResources/MSFT_SqlServerNetwork
- source/DSCResources/MSFT_SqlDatabaseOwner
- source/DSCResources/MSFT_SqlDatabaseRecoveryModel
ExcludeModuleFile:
- Modules/DscResource.Common
# Deprecated resources
- DSCResources/MSFT_SqlServerNetwork
- DSCResources/MSFT_SqlDatabaseOwner
- DSCResources/MSFT_SqlDatabaseRecoveryModel

Resolve-Dependency:
Gallery: 'PSGallery'
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ fixes:
ignore:
- 'source/DSCResources/MSFT_SqlServerNetwork'
- 'source/DSCResources/MSFT_SqlDatabaseOwner'
- 'source/DSCResources/MSFT_SqlDatabaseRecoveryModel'
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<#
DEPRECATION NOTICE:
THIS RESOURCE IS DEPRECATED!
Changes to this resource will no longer be merged. Instead please use the
resource SqlDatabase.
#>

$script:sqlServerDscHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\SqlServerDsc.Common'
$script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\DscResource.Common'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0"), FriendlyName("SqlDatabaseRecoveryModel")]
class DSC_SqlDatabaseRecoveryModel : OMI_BaseResource
class MSFT_SqlDatabaseRecoveryModel : OMI_BaseResource
{
[Key, Description("The SQL database name")] String Name;
[Key, Description("The name of the SQL instance to be configured.")] String InstanceName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ConvertFrom-StringData @'
GetRecoveryModel = Get the current recovery model of the database '{0}' in the instance '{1}'.
GetRecoveryModel = THIS RESOURCE IS DEPRECATED! Get the current recovery model of the database '{0}' in the instance '{1}'.
CurrentRecoveryModel = The current recovery model is '{0}' for the database '{1}'.
DatabaseNotFound = The database '{0}' does not exist.
SetRecoveryModel = Setting the recovery model of database '{0}'.
SetRecoveryModel = THIS RESOURCE IS DEPRECATED! Setting the recovery model of database '{0}'.
ChangeRecoveryModel = The recovery model for the database '{0}' was changed to '{1}'.
TestingConfiguration = Determines if the database '{0}' on the instance '{1}' has the desired recovery model.
'@
1 change: 0 additions & 1 deletion source/Examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ These are the links to the examples for each individual resource.
- [SqlDatabase](Resources/SqlDatabase)
- [SqlDatabaseDefaultLocation](Resources/SqlDatabaseDefaultLocation)
- [SqlDatabasePermission](Resources/SqlDatabasePermission)
- [SqlDatabaseRecoveryModel](Resources/SqlDatabaseRecoveryModel)
- [SqlDatabaseRole](Resources/SqlDatabaseRole)
- [SqlDatabaseUser](Resources/SqlDatabaseUser)
- [SqlRS](Resources/SqlRS)
Expand Down

This file was deleted.

Loading

0 comments on commit 7b0ba90

Please sign in to comment.