Command line utility that helps manage database migrations by extending DbUp using ideas from Rondhouse and Grate
- TODO One-time Scripts - run exactly once per database
- TODO Anytime Scripts - run any time script is added or updated
- TODO Everytime Scripts - run on every execution
-TODO
-TODO
- TODO Create New - drops and builds database from scratch
- TODO Update Only - updates to latest
- TODO AnyTime Service - runs in the background and runs update when AnyTime scripts are updated or added
- TODO
- TODO
- TODO
TODO
Accepts various configuration inputs using both System.CommandLine and Microsoft.Extensions.Hosting
Development, Staging, and Production profiles/environment are available, but the default is Production.
Configuration is set from highest to lowest priority based on the following inputs:
- Command Line
- Environment Variables
- Secret Manager when running in the Development environment
- appsettings.{environment}.json
- appsettings.json
The command line provides help documentation including configuration values that may be set via the command line. Use the -h modifier from the command line to access the help documentation. For example:
.\DbUpPlus.exe -help
or
.\DbUpPlus.exe run --h
Configuration values may be changed by setting system environment variables. The variables must be fully qualified. For example:
DBUPOPTIONS:RUNONETIMEOPTIONS:DROPDATABASE true
The environment is set by assigning the environment variable DOTNET_{environment}. Three environments are provided:
- DOTNET_ENVIRONMENT Development
- DOTNET_ENVIRONMENT Staging
- DOTNET_ENVIRONMENT Production (default)
The environment can also be set by assigning the launch profile to any of the three provided profiles: Development, Staging, and Production. These can be selected in Visual Studio or by command line. For example:
dotnet run --launch-profile Staging DbUpPlus -- run -h
Create a local postgresql server
docker run --name dbuptestdb -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres:latest
Add to user secrets or as an environment variable
DbUpOptions:GlobalOptions:ConnectionString "
=postgres;Password=password;Host=localhost;Port=5432;Database=dbuptestdb;"