Search Results for

    Fluent migrations framework for .NET (Apache 2.0 License)

    Fluent Migrator is a migration framework for .NET much like Ruby on Rails Migrations. Migrations are a structured way to alter your database schema and are an alternative to creating lots of sql scripts that have to be run manually by every developer involved. Migrations solve the problem of evolving a database schema for multiple databases (for example, the developer's local database, the test database and the production database). Database schema changes are described in classes written in C# that can be checked into a version control system.

    How to use it

    1. Database-agnostic migrations: Quickstart
    2. Database-specific migrations:
      1. SQL Server Extensions
      2. Postgres Extensions
    3. Frequently Asked Questions
    4. FluentMigrator Comparison to Entity Framework Core Migrations

    What does it look like?

    This is an example of a database-agnostic migration:

    using FluentMigrator;
    
    namespace test
    {
        [Migration(20180430121800)]
        public class AddLogTable : Migration
        {
            public override void Up()
            {
                Create.Table("Log")
                    .WithColumn("Id").AsInt64().PrimaryKey().Identity()
                    .WithColumn("Text").AsString();
            }
    
            public override void Down()
            {
                Delete.Table("Log");
            }
        }
    }
    

    Current Release

    • Release Notes

    Upgrade guides

    • 3.1 to 3.2
    • 3.0 to 3.1
    • 2.x to 3.0

    Supported databases

    For the current release these are the supported databases:

    Database Identifier Alternative identifier(s)
    Microsoft SQL Server 2022 SqlServer2016(1) SqlServer
    Microsoft SQL Server 2019 SqlServer2016(2) SqlServer
    Microsoft SQL Server 2017 SqlServer2016(3) SqlServer
    Microsoft SQL Server 2016 SqlServer2016 SqlServer
    Microsoft SQL Server 2014 SqlServer2014 SqlServer
    Microsoft SQL Server 2012 SqlServer2012 SqlServer
    Microsoft SQL Server 2008 SqlServer2008 SqlServer
    Microsoft SQL Server 2005 SqlServer2005 SqlServer
    Microsoft SQL Server 2000 SqlServer2000 SqlServer
    Microsoft SQL Server Compact Edition(4) SqlServerCe SqlServer
    PostgreSQL Postgres PostgreSQL
    PostgreSQL 9.2 Postgres92 PostgreSQL92
    PostgreSQL 10.0 PostgreSQL10_0 PostgreSQL
    PostgreSQL 11.0 PostgreSQL11_0 PostgreSQL
    PostgreSQL 15.0 PostgreSQL15_0 PostgreSQL
    MySQL 4 MySql4 MySql
    MySQL 5 MySql5 MySql, MariaDB
    MySQL 8 MySQL8 MySql, MariaDB
    Oracle Oracle
    Oracle (managed ADO.NET) OracleManaged Oracle
    Oracle (DotConnect ADO.NET) OracleDotConnect Oracle
    Microsoft JET Engine (Access) Jet
    SQLite Sqlite
    Firebird Firebird
    Amazon Redshift Redshift
    SAP Hana Hana
    SAP SQL Anywhere(5) SqlAnywhere16 SqlAnywhere
    DB2 DB2
    DB2 iSeries DB2 iSeries, IBM DB2 iSeries DB2
    • (1) All integration tests ran without error against an SQL Server 2019 using the SqlServer2016 dialect.
    • (2) All integration tests ran without error against an SQL Server 2019 using the SqlServer2016 dialect.
    • (3) All integration tests ran without error against an SQL Server 2017 using the SqlServer2016 dialect.
    • (4) Support for Microsoft SQL Server Compact Edition is being dropped due to Microsoft end-of-life support date passing.
    • (5) Support for SAP SQL Anywhere is being dropped due to SAP not supporting a .NET Core / .NET 5 database driver.

    More Information on FluentMigrator

    • FAQ
    • Sean Chambers on the Herding Code podcast
    • Edit this page
    In this article
    Back to top
    Copyright © 2018 Fluent Migrator Project
    Generated by DocFX
    Creative Commons License
    FluentMigrator Documentation by FluentMigrator Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.