C# Dotnet Core 3.1 application built on DBUp to deploy SQL based change sets to the major database engines.
Navigate to the folder that contains the projects .sln
file
- Build a project and its dependencies:
dotnet build
- Build a project and its dependencies using Release configuration:
dotnet build --configuration Release
- Build a project and its dependencies for a specific runtime (in this example, Ubuntu 18.04):
dotnet build --runtime ubuntu.18.04-x64
There are 5 steps configured which should cover 99% of scenarios
- Each steps runs in the order listed below.
- Each steps is essentially a folder within the relative path of the entry point
- Folder names will be affixed as a prefix to the script name
- If root folders don't exist at launch the app will create empty ones
- The application will recurse through the folders
- The application only looks for the following types of files
*.sql
- Scripts inside folders will be executed in numerical order so prefix them with the numerical order you want them to be executed in
- RunAlwaysPreScripts
- Scripts in step will always run. What this means is this step does not journal it's results to the schema table so it will always execute the scripts in this folder regardless
- PreDeploymentScripts
- Scripts in step will only ever execute a script once
- DeploymentScripts
- Scripts in step will only ever execute a script once
- PostDeploymentScripts
- Scripts in stepwill only ever execute a script once
- RunAlwaysPostScripts
- Scripts in step will always run. What this means is this step does not journal it's results to the schema table so it will always execute the scripts in this folder regardless
|- RunAlwaysPreScripts (required)
|- 01_Change_script_at_root.sql (file, optional)
|- 02_Change_script_at_root.sql (file, optional)
|- AZDO-12345 (folder, optional, Unique name for the folder used to track changeset grouping)
|- README.md (file, optional)
|- 01_Change_script.sql (file, optional)
|- 02_Change_script.sql (file, optional)
|- PreDeploymentScripts (required)
|- 01_Change_script_at_root.sql (file, optional)
|- 02_Change_script_at_root.sql (file, optional)
|- AZDO-12345 (folder, optional, Unique name for the folder used to track changeset grouping)
|- README.md (file, optional)
|- 01_Change_script.sql (file, optional)
|- 02_Change_script.sql (file, optional)
|- DeploymentScripts (required)
|- 01_Change_script_at_root.sql (file, optional)
|- 02_Change_script_at_root.sql (file, optional)
|- AZDO-12345 (folder, optional, Unique name for the folder used to track changeset grouping)
|- README.md (file, optional)
|- 01_Change_script.sql (file, optional)
|- 02_Change_script.sql (file, optional)
|- PostDeploymentScripts (required)
|- 01_Change_script_at_root.sql (file, optional)
|- 02_Change_script_at_root.sql (file, optional)
|- AZDO-12345 (folder, optional, Unique name for the folder used to track changeset grouping)
|- README.md (file, optional)
|- 01_Change_script.sql (file, optional)
|- 02_Change_script.sql (file, optional)
|- RunAlwaysPostScripts (required)
|- 01_Change_script_at_root.sql (file, optional)
|- 02_Change_script_at_root.sql (file, optional)
|- AZDO-12345 (folder, optional, Unique name for the folder used to track changeset grouping)
|- README.md (file, optional)
|- 01_Change_script.sql (file, optional)
|- 02_Change_script.sql (file, optional)
In the root of the application there is a appsettings.json
file that contains the following JSON object
{
"DbUpDataSource": "",
"DbEngineType": "",
"DbUpTimeout": 10
}
appsettings.json
is a required fileDbUpDataSource
is the datasource that will be used to initate the connection to your database engine- Below is a list of connection strings that has been tested against the supported database engines
DbEngineType
is the type of database engine- Below is a list of supported database engines
DbUpTimeout
set to define the timeout value in minutes for scripts being executed
mssql
Server=<host>,<port>;Database=<database>;User Id=<username>;Password=<password>;
mysql
Server=<host>;Port=<port>;Database=<database>;Uid=<username>;Pwd=<password>;
oracle
Data Source=<host>:<port>/<SID>;User Id=<username>;Password=<password>;
postgres
Host=<host>;Port=<port>;Database=<database>;Username=<username>;Password=<password>;SSL Mode=Require;Trust Server Certificate=true
redshift
Host=<host>;Port=<port>;Database=<database>;Username=<username>;Password=<password>;SSL Mode=Require;Trust Server Certificate=true;Server Compatibility Mode=Redshift