Install-Package Migrations -Version 1.0.1
dotnet add package Migrations --version 1.0.1
<PackageReference Include="Migrations" Version="1.0.1" />
paket add Migrations --version 1.0.1
This package will allow manage your database schema by running version scripts on application startup. The sql script will run once on startup of your application.
1. Add Migrations to your project
Add a directory Migrations, and add the sql scripts to the directory. Call the scripts 1, 2, 3 etc(or dates like 201521121242). Scripts will run in asc order and only once (numbers only). Embed the scripts as embedded resource in the dll. Make sure your go statements are at the end of the lines.
2. Mark the dll as Mirgration assembly
To pickup the migrations add the following attribute to your dll (with embedded migration files):
3. Call the migrations on startup
Add the following line of code in your startup sequence:
Support from version .net 4.0 and up
For more information see:
- log4net (>= 2.0.5)
This package is not used by any popular GitHub repositories.