Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for SQL 2016 (Fixes #26) #31

Merged
merged 6 commits into from Jan 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions DSCResources/MSFT_xDBPackage/MSFT_xDBPackage.psm1
Expand Up @@ -22,7 +22,7 @@ function Get-TargetResource
$Type,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion
)
Expand Down Expand Up @@ -54,7 +54,7 @@ function Set-TargetResource
$Type,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion
)
Expand Down Expand Up @@ -102,7 +102,7 @@ function Test-TargetResource
$Type,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion
)
Expand Down Expand Up @@ -232,6 +232,10 @@ function Get-SqlServerMajoreVersion([string]$sqlServerVersion)
{
$majorVersion = 120
}
"2016"
{
$majorVersion = 130
}
}

return $majorVersion
Expand Down
26 changes: 13 additions & 13 deletions DSCResources/MSFT_xDBPackage/MSFT_xDBPackage.schema.mof
@@ -1,13 +1,13 @@

[ClassVersion("1.0.0.0"), FriendlyName("xDBPackage")]
class MSFT_xDBPackage : OMI_BaseResource
{
[Write, EmbeddedInstance("MSFT_Credential"), Description("Credentials to Connect to the sql server")] String Credentials;
[Key, Description("Name of the Database")] String DatabaseName;
[Required, Description("Sql Server Name")] String SqlServer;
[Required, Description("Path to BacPac/DacPac")] String Path;
[Required, Description("Type for backup(Extract id done for DACPAC and Import for BACPAC)"), ValueMap{"DACPAC","BACPAC"}, Values{"DACPAC","BACPAC"}] String Type;
[Required, ValueMap{"2008-R2","2012","2014"}, Values{"2008-R2","2012","2014"}, Description("Sql Server Version For DacFx")] String SqlServerVersion;
};


[ClassVersion("1.0.0.0"), FriendlyName("xDBPackage")]
class MSFT_xDBPackage : OMI_BaseResource
{
[Write, EmbeddedInstance("MSFT_Credential"), Description("Credentials to Connect to the sql server")] String Credentials;
[Key, Description("Name of the Database")] String DatabaseName;
[Required, Description("Sql Server Name")] String SqlServer;
[Required, Description("Path to BacPac/DacPac")] String Path;
[Required, Description("Type for backup(Extract id done for DACPAC and Import for BACPAC)"), ValueMap{"DACPAC","BACPAC"}, Values{"DACPAC","BACPAC"}] String Type;
[Required, ValueMap{"2008-R2","2012","2014","2016"}, Values{"2008-R2","2012","2014","2016"}, Description("Sql Server Version For DacFx")] String SqlServerVersion;
};
6 changes: 3 additions & 3 deletions DSCResources/MSFT_xDatabase/MSFT_xDatabase.psm1
Expand Up @@ -28,7 +28,7 @@ function Get-TargetResource
$SqlServer,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion,

Expand Down Expand Up @@ -75,7 +75,7 @@ function Set-TargetResource
$SqlServer,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion,

Expand Down Expand Up @@ -148,7 +148,7 @@ function Test-TargetResource
$SqlServer,

[parameter(Mandatory = $true)]
[ValidateSet("2008-R2","2012","2014")]
[ValidateSet("2008-R2","2012","2014","2016")]
[System.String]
$SqlServerVersion,

Expand Down
32 changes: 16 additions & 16 deletions DSCResources/MSFT_xDatabase/MSFT_xDatabase.schema.mof
@@ -1,16 +1,16 @@

[ClassVersion("1.0.0.0"), FriendlyName("xDatabase")]
class MSFT_xDatabase : OMI_BaseResource
{
[Write, EmbeddedInstance("MSFT_Credential"), Description("Credentials to Connect to the sql server")] String Credentials;
[Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Sql Server Name")] String SqlServer;
[Required, ValueMap{"2008-R2","2012","2014"}, Values{"2008-R2","2012","2014"}, Description("Sql Server Version For DacFx")] String SqlServerVersion;
[Write, Description("Path to BacPac, if this is specified resore is performed")] String BacPacPath;
[Key, Description("Name of the Database")] String DatabaseName;
[Write, Description("Path to DacPac, if this is specified dacpac deployment is performed")] String DacPacPath;
[Write, Description("DacPac Application Name for Registration")] String DacPacApplicationName;
[Write, Description("DacPac Application Version for Registration")] String DacPacApplicationVersion;
};


[ClassVersion("1.0.0.0"), FriendlyName("xDatabase")]
class MSFT_xDatabase : OMI_BaseResource
{
[Write, EmbeddedInstance("MSFT_Credential"), Description("Credentials to Connect to the sql server")] String Credentials;
[Required, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("Sql Server Name")] String SqlServer;
[Required, ValueMap{"2008-R2","2012","2014","2016"}, Values{"2008-R2","2012","2014","2016"}, Description("Sql Server Version For DacFx")] String SqlServerVersion;
[Write, Description("Path to BacPac, if this is specified resore is performed")] String BacPacPath;
[Key, Description("Name of the Database")] String DatabaseName;
[Write, Description("Path to DacPac, if this is specified dacpac deployment is performed")] String DacPacPath;
[Write, Description("DacPac Application Name for Registration")] String DacPacApplicationName;
[Write, Description("DacPac Application Version for Registration")] String DacPacApplicationVersion;
};
4 changes: 4 additions & 0 deletions DSCResources/xDatabase_Common/xDatabase_Common.psm1
Expand Up @@ -223,6 +223,10 @@ function Get-SqlServerMajoreVersion([string]$sqlServerVersion)
{
$majorVersion = 120
}
"2016"
{
$majorVersion = 130
}
}

return $majorVersion
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -47,6 +47,7 @@ This property can take the following values: { 2008-R2 | 2012 | 2014 }
## Versions

### Unreleased
* Added support SQL Server 2016

### 1.6.0.0

Expand Down
@@ -1,12 +1,12 @@
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$leaf = Split-Path -Leaf $MyInvocation.MyCommand.Path
$source = "..\DSCResources\$($leaf.Split(".")[0])\$($leaf -replace ".Tests.ps1$",".psm1")"
$common = "..\DSCResources\xDatabase_Common\xDatabase_Common.psm1"
$source = "..\..\DSCResources\$($leaf.Split(".")[0])\$($leaf -replace ".Tests.ps1$",".psm1")"
$common = "..\..\DSCResources\xDatabase_Common\xDatabase_Common.psm1"

$testParameter = @{
Ensure = "Present"
SqlServer = "localhost"
SqlServerVersion = "2014"
SqlServerVersion = "2016"
DatabaseName = "test"
}

Expand Down