Curiosity.Migrations 4.3.1

dotnet add package Curiosity.Migrations --version 4.3.1
                    
NuGet\Install-Package Curiosity.Migrations -Version 4.3.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Curiosity.Migrations" Version="4.3.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Curiosity.Migrations" Version="4.3.1" />
                    
Directory.Packages.props
<PackageReference Include="Curiosity.Migrations" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Curiosity.Migrations --version 4.3.1
                    
#r "nuget: Curiosity.Migrations, 4.3.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Curiosity.Migrations&version=4.3.1
                    
Install Curiosity.Migrations as a Cake Addin
#tool nuget:?package=Curiosity.Migrations&version=4.3.1
                    
Install Curiosity.Migrations as a Cake Tool

Curiosity.Migrations Build Status License NuGet Downloads Documentation Status

Introduction

Curiosity.Migrations is a powerful, flexible database migration framework for .NET and .NET Core applications that gives you precise control over how your database evolves. It combines the performance and control of raw SQL with the flexibility of C# code migrations, all wrapped in a robust, enterprise-ready migration system.

Unlike ORM-specific migration tools, Curiosity.Migrations is database-focused and designed for scenarios where you need fine-grained control over migration execution, especially for large production databases where performance and safety are critical.

Why Use Curiosity.Migrations?

<table> <tr> <td width="50%" valign="top"> <h3>๐Ÿ”ง Precise Control</h3> <p>Write raw SQL when you need optimal performance, or use C# code when you need complex logic. You control exactly what runs against your database.</p> </td> <td width="50%" valign="top"> <h3>๐Ÿš€ Production-Ready</h3> <p>Built for enterprise applications with safety features, long-running migration support, and granular policies to control what runs in each environment.</p> </td> </tr> <tr> <td width="50%" valign="top"> <h3>๐Ÿ”„ Bidirectional</h3> <p>First-class support for downgrade migrations enables safe rollbacks when deployments don't go as planned.</p> </td> <td width="50%" valign="top"> <h3>๐Ÿ“Š Progressive Migrations</h3> <p>Separate long-running data migrations from quick schema changes to keep your application responsive during upgrades.</p> </td> </tr> <tr> <td width="50%" valign="top"> <h3>๐Ÿงช Testability</h3> <p>Create and initialize test databases with specific migration states for reliable integration testing.</p> </td> <td width="50%" valign="top"> <h3>๐Ÿงฉ Extensibility</h3> <p>Customize where migrations come from, how they're logged, and how they're applied to fit your workflow.</p> </td> </tr> </table>

Core Features

Migration Types

Safety and Control

  • Policies: Control which migrations run in different environments
  • Dependencies: Specify explicit requirements between migrations
  • Downgrade Migrations: Safely roll back changes when needed
  • Transactions: Configure transaction behavior per migration
  • Long-running vs Short-running: Separate quick schema changes from data-intensive operations

Extensibility

Quick Start

Installation

# Install core package
dotnet add package Curiosity.Migrations

# Install database provider (PostgreSQL or SQL Server)
dotnet add package Curiosity.Migrations.PostgreSQL
# or
dotnet add package Curiosity.Migrations.SqlServer

Basic Setup

// Configure the migration engine
var builder = new MigrationEngineBuilder(services)
    .UseScriptMigrations().FromDirectory("./Migrations")  // Add SQL migrations
    .UseCodeMigrations().FromAssembly(Assembly.GetExecutingAssembly())  // Add code migrations
    .ConfigureForPostgreSql("Host=localhost;Database=myapp;Username=postgres;Password=secret")
    .UseUpgradeMigrationPolicy(MigrationPolicy.AllAllowed);

// Build and run the engine
var migrationEngine = builder.Build();
var result = await migrationEngine.UpgradeDatabaseAsync();

// Check results
if (result.IsSuccessful)
{
    Console.WriteLine($"Successfully migrated");
}

Get started quickly with the Quick Start Guide or dive into Core Concepts.

Supported Databases

<table> <tbody> <tr> <td align="center" valign="middle"> <img src="https://raw.githubusercontent.com/siisltd/Curiosity.Migrations/master/docs/images/postgresql.png" width="200"> <br> <b>PostgreSQL</b> </td> <td align="center" valign="middle"> <img src="https://raw.githubusercontent.com/microsoft/sqlserver-graphics/main/Microsoft%20SQL%20Server/SVG/SQL%20Server%20logo%20(2022).svg" width="200"> <br> <b>SQL Server</b> </td> </tr> </tbody> </table>

Support for additional databases can be added through contributions.

Comparing with Alternatives

<table> <thead> <tr> <th>Feature</th> <th>Curiosity.Migrations</th> <th>EF Core Migrations</th> <th>FluentMigrator</th> <th>DbUp</th> </tr> </thead> <tbody> <tr> <td>Direct SQL Control</td> <td>โœ… Full</td> <td>โš ๏ธ Generated</td> <td>โš ๏ธ Generated</td> <td>โœ… Full</td> </tr> <tr> <td>Code Migrations</td> <td>โœ… Native</td> <td>โš ๏ธ Limited</td> <td>โš ๏ธ Via API</td> <td>โŒ No</td> </tr> <tr> <td>Downgrade Support</td> <td>โœ… First-class</td> <td>โš ๏ธ Limited</td> <td>โš ๏ธ Limited</td> <td>โŒ No</td> </tr> <tr> <td>Long-running Migrations</td> <td>โœ… Optimized</td> <td>โŒ No</td> <td>โŒ No</td> <td>โŒ No</td> </tr> <tr> <td>Migration Policies</td> <td>โœ… Configurable</td> <td>โŒ No</td> <td>โŒ No</td> <td>โŒ No</td> </tr> <tr> <td>DI Support</td> <td>โœ… Native</td> <td>โš ๏ธ Limited</td> <td>โš ๏ธ Limited</td> <td>โš ๏ธ Basic</td> </tr> <tr> <td>Best For</td> <td>Enterprise apps, complex migrations, performance-critical systems</td> <td>Simple CRUD apps with EF Core</td> <td>Cross-database projects</td> <td>Simple script runners</td> </tr> </tbody> </table>

For more detailed comparisons, see The Philosophy Behind Curiosity.Migrations.

Available Packages

Package Version Downloads
Curiosity.Migrations NuGet NuGet
Curiosity.Migrations.PostgreSQL NuGet NuGet
Curiosity.Migrations.SqlServer NuGet NuGet

Documentation

Community and Support

License

Curiosity.Migrations is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 is compatible. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Curiosity.Migrations:

Package Downloads
Curiosity.Migrations.PostgreSQL

Curiosity.Migrations is a migration framework that uses SQL scripts and code migration to alter your database schema or seed a data.

Curiosity.Migrations.Utils

Without migrations you need to create a 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).

Curiosity.Migrations.SqlServer

Curiosity.Migrations is a migration framework that uses SQL scripts and code migration to alter your database schema or seed a data.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.3.1 152 5/1/2025
4.3.0 332 11/14/2023
4.2.0 262 4/21/2023
4.1.3 300 4/14/2023
4.1.2 227 4/12/2023
4.1.1 211 4/12/2023
4.0.2 219 4/12/2023
4.0.1 455 4/10/2023
4.0.0 343 4/10/2023
3.1.0 490 7/29/2022
3.0.7 507 4/21/2022
3.0.6 494 3/1/2022
3.0.5 459 3/1/2022
3.0.4 897 8/3/2021
3.0.3 527 3/8/2021
3.0.2 606 12/10/2020
3.0.1 455 12/9/2020
3.0.0 568 12/8/2020
2.2.0 631 10/16/2020
2.1.0 632 9/21/2020
2.0.0 697 5/14/2020
1.2.0 674 4/23/2020
1.1.1 693 4/1/2020
1.1.0 701 3/24/2020
1.0.0 736 2/11/2020