DotNetBrightener.DataAccess.DataMigration 2024.0.14.6-preview-1900801

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-preview-1900801                
NuGet\Install-Package DotNetBrightener.DataAccess.DataMigration -Version 2024.0.14.6-preview-1900801                
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-preview-1900801" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DotNetBrightener.DataAccess.DataMigration --version 2024.0.14.6-preview-1900801                
#r "nuget: DotNetBrightener.DataAccess.DataMigration, 2024.0.14.6-preview-1900801"                
#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.
// Install DotNetBrightener.DataAccess.DataMigration as a Cake Addin
#addin nuget:?package=DotNetBrightener.DataAccess.DataMigration&version=2024.0.14.6-preview-1900801&prerelease

// Install DotNetBrightener.DataAccess.DataMigration as a Cake Tool
#tool nuget:?package=DotNetBrightener.DataAccess.DataMigration&version=2024.0.14.6-preview-1900801&prerelease                

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. 
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.Mssql

Package Description

DotNetBrightener.DataAccess.DataMigration.PostgreSql

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2025.0.3 94 20 days ago
2025.0.3-preview-288 98 21 days ago
2025.0.2 111 a month ago
2025.0.2-preview-278 82 a month ago
2025.0.2-preview-277 91 2 months ago
2025.0.1-rc-243301701 272 3 months ago
2024.0.14.6 101 3 months ago
2024.0.14.6-rc-243031001 180 4 months ago
2024.0.14.6-rc-243030701 99 4 months ago
2024.0.14.6-rc-242840501 92 5 months ago
2024.0.14.6-rc-242820305 86 5 months ago
2024.0.14.6-rc-242771401 185 5 months ago
2024.0.14.6-rc-242770501 93 5 months ago
2024.0.14.6-rc-242770201 96 5 months ago
2024.0.14.6-rc-242761801 90 5 months ago
2024.0.14.6-rc-242761601 102 5 months ago
2024.0.14.6-rc-242761501 85 5 months ago
2024.0.14.6-rc-242761401 98 5 months ago
2024.0.14.6-rc-242760701 106 5 months ago
2024.0.14.6-rc-242751002 89 5 months ago
2024.0.14.6-rc-242750901 100 5 months ago
2024.0.14.6-rc-242750502 90 5 months ago
2024.0.14.6-rc-242750201 93 5 months ago
2024.0.14.6-rc-242741501 88 5 months ago
2024.0.14.6-rc-242730701 117 5 months ago
2024.0.14.6-preview-2730501 82 5 months ago
2024.0.14.6-preview-2701501 124 5 months ago
2024.0.14.6-preview-2620901 149 5 months ago
2024.0.14.6-preview-2570701 92 6 months ago
2024.0.14.6-preview-2510703 161 6 months ago
2024.0.14.6-preview-2480501 116 6 months ago
2024.0.14.6-preview-2430401 130 6 months ago
2024.0.14.6-preview-242730701 91 5 months ago
2024.0.14.6-preview-2421703 98 6 months ago
2024.0.14.6-preview-2421701 97 6 months ago
2024.0.14.6-preview-2420901 96 6 months ago
2024.0.14.6-preview-2390101 110 6 months ago
2024.0.14.6-preview-2381603 126 6 months ago
2024.0.14.6-preview-2341601 144 6 months ago
2024.0.14.6-preview-2321602 137 6 months ago
2024.0.14.6-preview-2190801 165 7 months ago
2024.0.14.6-preview-2041501 103 7 months ago
2024.0.14.6-preview-1920603 152 8 months ago
2024.0.14.6-preview-1920301 120 8 months ago
2024.0.14.6-preview-1911302 104 8 months ago
2024.0.14.6-preview-1901001 117 8 months ago
2024.0.14.6-preview-1900901 98 8 months ago
2024.0.14.6-preview-1900801 97 8 months ago
2024.0.14.6-preview-1860304 105 8 months ago
2024.0.14.5 165 8 months ago
2024.0.14.5-preview-1811601 111 8 months ago
2024.0.14.5-preview-1810501 126 8 months ago
2024.0.14.5-preview-180132 129 8 months ago
2024.0.14.5-preview-180131 116 8 months ago
2024.0.14.5-preview-180121 101 8 months ago
2024.0.14.4 129 8 months ago
2024.0.14.4-preview-8 111 8 months ago
2024.0.14.4-preview-7 111 8 months ago
2024.0.14.3 127 8 months ago
2024.0.14.1 125 9 months ago
2024.0.14.1-preview 104 9 months ago
2024.0.14-preview-1 105 9 months ago
2024.0.13.8-preview 110 9 months ago
2024.0.13.1-preview-0146 106 9 months ago
2024.0.13-preview-1 96 9 months ago
2024.0.12.15803-preview-03 113 9 months ago
2024.0.12.15608 125 9 months ago
2024.0.12.15515 180 9 months ago
2024.0.12.15220 116 9 months ago
2024.0.12.15220-alpha31-240... 89 9 months ago
2024.0.12.14911 144 9 months ago
2024.0.12.14910-alpha28-240... 106 9 months ago
2024.0.12.14823 118 9 months ago
2024.0.12.14522-alpha7-2405... 118 9 months ago
2024.0.12.14514-alpha6-2405... 105 9 months ago
2024.0.12.14511 141 9 months ago
2024.0.12.14314 160 9 months ago
2024.0.12.14114 160 9 months ago
2024.0.12.12815 161 10 months ago
2024.0.12.12814 123 10 months ago
2024.0.12.12721 142 10 months ago
2024.0.12.12702 131 10 months ago
2024.0.12.12622 161 10 months ago
2024.0.12.12514 138 10 months ago
2024.0.12.12512 136 10 months ago
2024.0.12.12510 140 10 months ago
2024.0.12.12420 105 10 months ago
2024.0.12.12319 97 10 months ago
2024.0.12.12319-rc-2405021801 74 10 months ago
2024.0.12.12318 93 10 months ago