Skip to content

Latest commit

 

History

History
71 lines (58 loc) · 3.27 KB

README.md

File metadata and controls

71 lines (58 loc) · 3.27 KB

Evolve Build status Build Status NuGet

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!

Supported Databases

  • PostgreSQL
  • SQLite
  • SQL Server
  • MySQL / MariaDB
  • Oracle support (for .NET Framework only)

Supported Modes

  • MSBuild
  • In-app
  • .NET Core CLI tools (dotnet build)

Supported Frameworks

  • .NET 3.5+
  • .NET 4.5.1+
  • .NET Core 1.0+

Installation

PM> Install-Package Evolve

Quick Start

  1. Add a reference to the NuGet Evolve package in your project.
  2. 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"
}
  1. Create a folder Sql_Scripts at the root of your project directory.
  2. 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
  1. 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 and issues

Feedback, improvements, ideas are welcomed. Feel free to create new issues at the issues section and/or send emails to [email protected]

Credits

Again, many thanks to the Flyway project. Great idea, big inspiration, a tool that I could not do without in .NET.