This project is merely a placeholder for my attempt to learn how to work with DbUp. As I find their documentation a bit lacking, I'm hoping to be able to add to it through my attempts of learning the library with this repo.
dotnet new console
dotnet add package Microsoft.Data.Sqlite
dotnet add package DbUp-core
dotnet add package DbUp-sqlite
dotnet new console
dotnet add package Npgsql
dotnet add package DbUp-core
dotnet add package DbUp-postgresql
Configuration shouldn't be stored in the source-code, so to not spread bad behaviours, this sample-project uses Microsoft.Extensions.Configuration
to read from a JSON-file.
dotnet add package Microsoft.Extensions.Configuration
dotnet add package Microsoft.Extensions.Configuration.Json
Add the following between <Project>...</Project>
<ItemGroup>
<EmbeddedResource Include="migrations/*.sql" />
</ItemGroup>
You can also add each script as separate <EmbeddedResource>
rows if that is preferred over a wildcard like the example above.
These two files are meant to be changed according to each user's desire/needs, so to stop git from tracking changes to them on your machine, run these commands:
git update-index --skip-worktree appsettings.json
git update-index --skip-worktree .env
These steps are written based on:
- The user is running on Windows
- The user has installed Python 3.x
- The user has not created a virtual environment (venv) yet
- The three dependencies are defined in the file
requirements.in
(without a version to make it install the latest version)
python -m venv docs
cd docs
.\Scripts\Activate.ps1
python -m pip install pip-tools mkdocs mkdocstrings[python] markdown-include
pip-compile requirements.in