DotNetBrightener.DataAccess.DataMigration 2024.0.14.6-rc-243031001

This is a prerelease version of DotNetBrightener.DataAccess.DataMigration.
There is a newer version of this package available.
See the version list below for details.
dotnet add package DotNetBrightener.DataAccess.DataMigration --version 2024.0.14.6-rc-243031001
                    
NuGet\Install-Package DotNetBrightener.DataAccess.DataMigration -Version 2024.0.14.6-rc-243031001
                    
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="DotNetBrightener.DataAccess.DataMigration" Version="2024.0.14.6-rc-243031001" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotNetBrightener.DataAccess.DataMigration" Version="2024.0.14.6-rc-243031001" />
                    
Directory.Packages.props
<PackageReference Include="DotNetBrightener.DataAccess.DataMigration" />
                    
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 DotNetBrightener.DataAccess.DataMigration --version 2024.0.14.6-rc-243031001
                    
#r "nuget: DotNetBrightener.DataAccess.DataMigration, 2024.0.14.6-rc-243031001"
                    
#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 DotNetBrightener.DataAccess.DataMigration@2024.0.14.6-rc-243031001
                    
#: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=DotNetBrightener.DataAccess.DataMigration&version=2024.0.14.6-rc-243031001&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DotNetBrightener.DataAccess.DataMigration&version=2024.0.14.6-rc-243031001&prerelease
                    
Install as a Cake Tool

Data Migration Library for .NET Core Applications

© 2024 DotNet Brightener

Versions

Package Version
DotNetBrightener.DataAccess.DataMigration NuGet Version
DotNetBrightener.DataAccess.DataMigration.Mssql NuGet Version
DotNetBrightener.DataAccess.DataMigration.PostgreSql NuGet Version
dotnet-dnb-datamigration NuGet Version

Overview

Data Migration Library is a simple library to help you manage your data migration in your .NET Core application. It provides a simple way to define your migration classes and run them in your application.

Not all applications can use DACPAC for managing database schema and data changes. Especially DACPAC does not work with other databases such as MySQL, PostgreSQL, etc. This library is designed to help you manage your data migration in your application.

Installation

Install using Package Reference

dotnet add [YOUR_PROJECT_NAME] package DotNetBrightener.DataAccess.DataMigration

If you need to data migration with SQL Server, install the following package: DotNetBrightener.DataAccess.DataMigration.Mssql

dotnet add [YOUR_PROJECT_NAME] package DotNetBrightener.DataAccess.DataMigration.Mssql

For PostgreSQL, install the following package: DotNetBrightener.DataAccess.DataMigration.PostgreSql

dotnet add [YOUR_PROJECT_NAME] package DotNetBrightener.DataAccess.DataMigration.PostgreSql

Usage

Register to Service Collection
// var _connectionString = "<your_connection_string>";

// If you use SQL Server
services.EnableDataMigrations()
        .UseSqlServer(_connectionString);

// If you use PostgreSQL
services.EnableDataMigrations()
        .UseNpgsql(_connectionString);

// if you want to auto detect all migration classes
services.AutoScanDataMigrators();

// if you want to manually register migration classes
services.AddDataMigrator<MyMigration>();

Define your migration classes

using DotNetBrightener.DataAccess.DataMigration;

[DataMigration("<your_migration_id>")]
public class MyMigration : IDataMigration
{
    // You can use Dependency Injection for injecting your services
    private readonly IMyService _myService;

    public MyMigration(IMyService myService)
    {
        _myService = myService;
    }

    public async Task MigrateData()
    {
        // Your migration code here
        await _myService.DoSomethingToMigrateData();
    }
}

Roadmap

  • Initial Release
  • Add Support for SQL Server
  • Add Support for PostgreSQL
  • CLI tool for creating migration class

CLI Tool

You can now install the cli tool from Nuget: dotnet-dnb-datamigration

Product Compatible and additional computed target framework versions.
.NET 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 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.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DotNetBrightener.DataAccess.DataMigration:

Package Downloads
DotNetBrightener.DataAccess.DataMigration.PostgreSql

Package Description

DotNetBrightener.DataAccess.DataMigration.Mssql

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2025.0.8 46 9/23/2025
2025.0.6 72 9/22/2025
2025.0.6-preview-455 78 9/22/2025
2025.0.6-preview-454 290 9/17/2025
2025.0.6-preview-441 128 9/14/2025
2025.0.6-preview-440 127 9/14/2025
2025.0.6-preview-406 158 9/2/2025
2025.0.6-preview-401 150 9/2/2025
2025.0.6-preview-400 154 9/2/2025
2025.0.6-preview-369 208 8/27/2025
2025.0.6-preview-368 195 8/27/2025
2025.0.6-preview-334 173 8/18/2025
2025.0.6-preview-333 108 7/27/2025
2025.0.6-preview-332 479 7/24/2025
2025.0.6-preview-331 488 7/24/2025
2025.0.6-preview-328 474 7/24/2025
2025.0.6-preview-327 348 7/21/2025
2025.0.6-preview-326 336 7/21/2025
2025.0.6-preview-325 258 7/20/2025
2025.0.6-preview-324 250 7/20/2025
2025.0.6-preview-322 255 7/20/2025
2025.0.6-preview-321 248 7/19/2025
2025.0.6-preview-320 257 7/19/2025
2025.0.6-preview-319 162 7/17/2025
2025.0.6-preview-317 157 7/17/2025
2025.0.6-preview-316 160 7/17/2025
2025.0.6-preview-315 152 7/17/2025
2025.0.6-preview-314 163 7/17/2025
2025.0.6-preview-313 162 7/17/2025
2025.0.6-preview-312 169 7/16/2025
2025.0.5 180 7/10/2025
2025.0.5-preview-307 104 7/5/2025
2025.0.4 102 7/5/2025
2025.0.4-preview-305 110 7/4/2025
2025.0.4-preview-304 159 7/1/2025
2025.0.4-preview-299 148 5/31/2025
2025.0.4-preview-298 127 5/30/2025
2025.0.4-preview-296 166 5/30/2025
2025.0.4-preview-295 172 5/29/2025
2025.0.4-preview-293 173 5/26/2025
2025.0.4-preview-292 171 5/26/2025
2025.0.3 164 2/10/2025
2025.0.3-preview-288 143 2/10/2025
2025.0.2 157 1/21/2025
2025.0.2-preview-278 125 1/21/2025
2025.0.2-preview-277 134 12/16/2024
2025.0.1-rc-243301701 402 11/25/2024
2024.0.14.6 150 11/25/2024
2024.0.14.6-rc-243031001 222 10/29/2024
2024.0.14.6-rc-243030701 140 10/29/2024
2024.0.14.6-rc-242840501 130 10/10/2024
2024.0.14.6-rc-242820305 126 10/8/2024
2024.0.14.6-rc-242771401 224 10/3/2024
2024.0.14.6-rc-242770501 131 10/3/2024
2024.0.14.6-rc-242770201 132 10/3/2024
2024.0.14.6-rc-242761801 130 10/2/2024
2024.0.14.6-rc-242761601 143 10/2/2024
2024.0.14.6-rc-242761501 129 10/2/2024
2024.0.14.6-rc-242761401 137 10/2/2024
2024.0.14.6-rc-242760701 139 10/2/2024
2024.0.14.6-rc-242751002 134 10/1/2024
2024.0.14.6-rc-242750901 148 10/1/2024
2024.0.14.6-rc-242750502 136 10/1/2024
2024.0.14.6-rc-242750201 129 10/1/2024
2024.0.14.6-rc-242741501 120 9/30/2024
2024.0.14.6-rc-242730701 156 9/29/2024
2024.0.14.6-preview-2730501 121 9/29/2024
2024.0.14.6-preview-2701501 167 9/26/2024
2024.0.14.6-preview-2620901 178 9/18/2024
2024.0.14.6-preview-2570701 129 9/13/2024
2024.0.14.6-preview-2510703 196 9/7/2024
2024.0.14.6-preview-2480501 149 9/4/2024
2024.0.14.6-preview-2430401 161 8/30/2024
2024.0.14.6-preview-242730701 119 9/29/2024
2024.0.14.6-preview-2421703 129 8/29/2024
2024.0.14.6-preview-2421701 128 8/29/2024
2024.0.14.6-preview-2420901 134 8/29/2024
2024.0.14.6-preview-2390101 136 8/26/2024
2024.0.14.6-preview-2381603 162 8/25/2024
2024.0.14.6-preview-2341601 185 8/21/2024
2024.0.14.6-preview-2321602 179 8/20/2024
2024.0.14.6-preview-2190801 203 8/6/2024
2024.0.14.6-preview-2041501 128 7/22/2024
2024.0.14.6-preview-1920603 190 7/10/2024
2024.0.14.6-preview-1920301 161 7/10/2024
2024.0.14.6-preview-1911302 145 7/9/2024
2024.0.14.6-preview-1901001 152 7/8/2024
2024.0.14.6-preview-1900901 139 7/8/2024
2024.0.14.6-preview-1900801 146 7/8/2024
2024.0.14.6-preview-1860304 144 7/4/2024
2024.0.14.5 203 7/1/2024
2024.0.14.5-preview-1811601 138 6/29/2024
2024.0.14.5-preview-1810501 160 6/29/2024
2024.0.14.5-preview-180132 177 6/28/2024
2024.0.14.5-preview-180131 151 6/28/2024
2024.0.14.5-preview-180121 139 6/28/2024
2024.0.14.4 168 6/27/2024
2024.0.14.4-preview-8 144 6/27/2024
2024.0.14.4-preview-7 152 6/27/2024
2024.0.14.3 164 6/21/2024
2024.0.14.1 163 6/6/2024
2024.0.14.1-preview 143 6/6/2024
2024.0.14-preview-1 148 6/6/2024
2024.0.13.8-preview 138 6/6/2024
2024.0.13.1-preview-0146 132 6/6/2024
2024.0.13-preview-1 122 6/6/2024
2024.0.12.15803-preview-03 137 6/6/2024
2024.0.12.15608 164 6/4/2024
2024.0.12.15515 216 6/3/2024
2024.0.12.15220 154 5/31/2024
2024.0.12.15220-alpha31-240... 124 5/31/2024
2024.0.12.14911 172 5/28/2024
2024.0.12.14910-alpha28-240... 138 5/28/2024
2024.0.12.14823 165 5/27/2024
2024.0.12.14522-alpha7-2405... 145 5/24/2024
2024.0.12.14514-alpha6-2405... 147 5/24/2024
2024.0.12.14511 180 5/24/2024
2024.0.12.14314 198 5/22/2024
2024.0.12.14114 202 5/20/2024
2024.0.12.12815 203 5/7/2024
2024.0.12.12814 156 5/7/2024
2024.0.12.12721 180 5/6/2024
2024.0.12.12702 166 5/5/2024
2024.0.12.12622 201 5/5/2024
2024.0.12.12514 184 5/4/2024
2024.0.12.12512 171 5/4/2024
2024.0.12.12510 179 5/4/2024
2024.0.12.12420 133 5/3/2024
2024.0.12.12319 144 5/2/2024
2024.0.12.12319-rc-2405021801 115 5/2/2024
2024.0.12.12318 135 5/2/2024