Database migration tool for .NET and .NET Core. Inspired by Flyway.
Evolve is an easy migration tool that uses plain old sql scripts. Its purpose is to automate your database changes, and help keep those changes synchronized through all your environments and development teams. This makes it an ideal tool for continuous integration / delivery.
Over all Evolve embraces simplicity. Every time you build your project, it will automatically ensure that your database is up-to-date, without having to do anything other than build. Install it and forget it!
- PostgreSQL
- SQLite
- SQL Server
- MySQL / MariaDB
- Oracle support (for .NET Framework only)
- MSBuild
- In-app
- .NET Core CLI tools (
dotnet build
)
- .NET 3.5+
- .NET 4.5.1+
- .NET Core 1.0+
PM> Install-Package Evolve
- Add a reference to the NuGet Evolve package in your project.
- Add at least those variables to your project configuration file and update their values according to your environment:
Example of an App.config / Web.config for a .NET project
<appSettings>
<add key="Evolve.ConnectionString" value="Server=127.0.0.1;Port=5432;Database=my_db;User Id=postgres;Password=postgres;" />
<add key="Evolve.Driver" value="npgsql" /> <!-- or sqlserver or microsoftdatasqlite or sqlite or mysql or mariadb -->
<add key="Evolve.Locations" value="Sql_Scripts" />
<add key="Evolve.Command" value="migrate" />
</appSettings>
Example of an evolve.json file for a .NET Core application
{
"Evolve.ConnectionString": "Server=127.0.0.1;Database=Northwind;User Id=sa;Password=Password12!;",
"Evolve.Driver": "sqlserver",
"Evolve.Locations": "Sql_Scripts/SQLServer/Sql",
"Evolve.Command": "migrate"
}
- Create a folder Sql_Scripts at the root of your project directory.
- And add your sql migration scripts following this file name structure. Example: V1_3_1__Create_table.sql:
- prefix: configurable, default: V
- version: numbers separated by _ (one underscore)
- separator: configurable, default: __ (two underscores)
- description: words separated by underscores
- suffix: configurable, default: .sql
- Next time you build your project, Evolve will start and run your migration scripts automatically.
Please refer to the wiki pages for a complete documentation on how to master Evolve.
Feedback, improvements, ideas are welcomed. Feel free to create new issues at the issues section and/or send emails to evolve-db@hotmail.com
Again, many thanks to the Flyway project. Great idea, big inspiration, a tool that I could not do without in .NET.