Curiosus.Migrations.SqlServer 5.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Curiosus.Migrations.SqlServer --version 5.0.0
                    
NuGet\Install-Package Curiosus.Migrations.SqlServer -Version 5.0.0
                    
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="Curiosus.Migrations.SqlServer" Version="5.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Curiosus.Migrations.SqlServer" Version="5.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Curiosus.Migrations.SqlServer" />
                    
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 Curiosus.Migrations.SqlServer --version 5.0.0
                    
#r "nuget: Curiosus.Migrations.SqlServer, 5.0.0"
                    
#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.
#:package Curiosus.Migrations.SqlServer@5.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Curiosus.Migrations.SqlServer&version=5.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Curiosus.Migrations.SqlServer&version=5.0.0
                    
Install as a Cake Tool

Curiosus.Migrations Build Status License NuGet Downloads Documentation Status

Renamed: formerly Curiosity.Migrations* by SIIS Ltd. Since 5.0.0 the packages are published as Curiosus.Migrations* by curiosus-dev. To migrate, replace Curiosity with Curiosus in package references and code. -- CURIOSITY: directives in SQL scripts keep working.

Introduction

Curiosus.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, Curiosus.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 Curiosus.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 Curiosus.Migrations

# Install database provider (PostgreSQL or SQL Server)
dotnet add package Curiosus.Migrations.PostgreSQL
# or
dotnet add package Curiosus.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/Curiosus.Migrations/refs/heads/master/docs/images/postgresql.png" width="200"> <br> <b>PostgreSQL</b> </td> <td align="center" valign="middle"> <img src="https://raw.githubusercontent.com/siisltd/Curiosus.Migrations/refs/heads/master/docs/images/sqlserver.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>Curiosus.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 Curiosus.Migrations.

Available Packages

Package Version Downloads
Curiosus.Migrations NuGet NuGet
Curiosus.Migrations.PostgreSQL NuGet NuGet
Curiosus.Migrations.SqlServer NuGet NuGet
Curiosus.Migrations.Utils NuGet NuGet

Community and Support

License

Curiosus.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 is compatible.  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 is compatible.  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.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.1 53 10/3/2026
6.0.0 60 9/29/2026
5.0.0 53 9/28/2026