This example shows how to combine SolutionScripts and SqlDatabase
Open this solution in the Visual Studio. Open Package manage console (in the VS menu Tools/NuGet Package Manager/Package Manager Console)
As you can see there are 2 cmd-lets are available:
- Install-Database: create database based on scripts from CreateDatabaseFolder example
- Update-Database: upgrade database based on scripts from MigrationStepsFolder example
Cmd-lets are loaded into the powershell session by NuGet package SolutionScripts, details are here.
Both cmd-lets take connection string from SomeApp/App.config file and invoke SqlDatabase.
Important: after the first initialization any changes in the SolutionScripts are not visible to the package manager console. Invoke Update-SolutionScripts command in the console to apply changes.