-
Notifications
You must be signed in to change notification settings - Fork 2
SQLDeploy
As of SQLDeploy package version 2.3, the Nuget package defaults to using DacPacs for SQL Server database deployments. Prior versions didn't specify any deployment by default which required more setup by the user to configure what to deploy and how. We believe this change will make SQLDeploy as easy as possible to get started with. That being said, all older SQL deployment options still exist in the package if you need them.
-
Add a new Class Library project to your solution which will act as your SQL deployment project
-
Add the MSDeployAllTheThings.SqlDeploy Nuget package to your SQL deployment project
-
Open the
[ProjectName].spp.targets
file and update the DatabaseProject node to the name of the SQLServer database project in your solution. -
Build the project with the
/p:DeployOnBuild=true
flag and the MSDeploy package will be created in thebin/[configuration]/sqlDeployment
folder.
This seems odd to use a Class Library Project to deploy a SQL database. We would prefer to use the Database Project itself but the problem is Nuget doesn't allow you to add a package to a Database project. Not sure why. So, you need another project, it doesn't matter what kind, that will kickoff MSBuild and support Nuget packages.