Chd.Library.Migrations
8.0.9
See the version list below for details.
dotnet add package Chd.Library.Migrations --version 8.0.9
NuGet\Install-Package Chd.Library.Migrations -Version 8.0.9
<PackageReference Include="Chd.Library.Migrations" Version="8.0.9" />
<PackageVersion Include="Chd.Library.Migrations" Version="8.0.9" />
<PackageReference Include="Chd.Library.Migrations" />
paket add Chd.Library.Migrations --version 8.0.9
#r "nuget: Chd.Library.Migrations, 8.0.9"
#:package Chd.Library.Migrations@8.0.9
#addin nuget:?package=Chd.Library.Migrations&version=8.0.9
#tool nuget:?package=Chd.Library.Migrations&version=8.0.9
Migration library for .Net Core
Chd (cleverly handle difficulty) library helps you cleverly handle difficulty, writing code fastly and do your application stable.
📝 Table of Contents
- About
- Getting Started
- Running the tests for PostgreSQL datatabase
- Running the tests for Oracle datatabase
- Running the tests for Mssql datatabase
- Running the tests for SqlLite datatabase
- Usage
- Authors
- Acknowledgments
🧐 About
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.
🏁 Getting Started
This migrations using a table called VersionInfo. Each record in this table contains a unique VersionId.
Prerequisites
You must use .net core 8.0 or higher
🔧 Running the tests for PostgreSQL datatabase
[TestClass]
public class MigrationTestForPostgreSQL
{
[Logged]
[TestMethod]
public void Test()
{
// ==> builder.Services.UseMigration<Program>(Library.Migrations.Enums.DatabaseType.PostgreSQL,"PostgreSQLTest"); //In project usings
MigrationDependencyInjectionExtensions.AddMigration<MigrationForPostgreSQL>(null, Library.Migrations.Enums.DatabaseType.PostgreSQL, "PostgreSQLTest");
Thread.Sleep(30000);
}
}
[Migration(12,"mehmet")]
public class MigrationForPostgreSQL : Migration
{
public override void Down()
{
}
public override void Up()
{
Create.Table("deneme").WithIdColumn().WithColumn("name").AsString();
}
}
🔧 Running the tests for Oracle datatabase
[TestClass]
public class MigrationTestForOracle
{
[Logged]
[TestMethod]
public void Test()
{
//==> builder.Services.UseMigration<Program>(Library.Migrations.Enums.DatabaseType.SQLite,"OracleTest"); //In project usings
MigrationDependencyInjectionExtensions.AddMigration<MigrationForOracle>(null, Library.Migrations.Enums.DatabaseType.SQLite, "OracleTest");
Thread.Sleep(30000);
}
}
[Migration(12,"mehmet")]
public class MigrationForOracle : Migration
{
public override void Down()
{
}
public override void Up()
{
Create.Table("deneme").WithIdColumn().WithColumn("name").AsString();
}
}
🔧 Running the tests for MsSQL datatabase
[TestClass]
public class MigrationTestForMsSQL
{
[Logged]
[TestMethod]
public void Test()
{
// ==> builder.Services.UseMigration<Program>(Library.Migrations.Enums.DatabaseType.MsSQL,"MsSQLTest"); //In project usings
MigrationDependencyInjectionExtensions.AddMigration<MigrationForMsSQL>(null, Library.Migrations.Enums.DatabaseType.MsSQL, "MsSQLTest");
Thread.Sleep(30000);
}
}
[Migration(12,"mehmet")]
public class MigrationForMsSQL : Migration
{
public override void Down()
{
}
public override void Up()
{
Create.Table("deneme").WithIdColumn().WithColumn("name").AsString();
}
}
🔧 Running the tests for SQLite datatabase
[TestClass]
public class MigrationTestForSQLite
{
[Logged]
[TestMethod]
public void Test()
{
// ==> builder.Services.UseMigration<Program>(Library.Migrations.Enums.DatabaseType.SQLite,"SQLiteTest"); //In project usings
MigrationDependencyInjectionExtensions.AddMigration<MigrationForSQLite>(null, Library.Migrations.Enums.DatabaseType.SQLite, "SQLiteTest");
Thread.Sleep(30000);
}
}
[Migration(12,"mehmet")]
public class MigrationForSQLite : Migration
{
public override void Down()
{
}
public override void Up()
{
Create.Table("deneme").WithIdColumn().WithColumn("name").AsString();
}
}
Apsettings Configurations
You must add code below in appsettings.json
"ConnectionStrings": {
"SQLiteTest": "Data Source=mydb.db;",
"OracleTest":"Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;",
"MsSQLTest": "Data Source=mydb.db;",
"PostgreSQLTest": "IncludeErrorDetails = true;User ID=postgres;Password=library_postgres_admin;Server=localhost;Port=5432;Database=KUSYS_db;Integrated Security=true;Pooling=true;",
}
Test Result
After running test, you can see sample table on database.
🎈 Usage
Just run the application to get the migrations work done.
✍️ Authors
- Mehmet Yoldaş - Linkedin
See also the list of contributors who participated in this project.
🎉 Acknowledgements
Thank you for using my library.
| Product | Versions 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. |
-
net8.0
- Chd.Library.Core (>= 8.0.1)
- FluentMigrator.Runner (>= 3.3.2)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Data.Sqlite (>= 8.0.1)
- Microsoft.EntityFrameworkCore.Design (>= 8.0.1)
- Microsoft.EntityFrameworkCore.Sqlite (>= 8.0.1)
- Microsoft.EntityFrameworkCore.Sqlite.Core (>= 8.0.1)
- Microsoft.EntityFrameworkCore.SqlServer (>= 8.0.1)
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 |
|---|---|---|
| 8.7.0 | 129 | 3/5/2026 |
| 8.6.5 | 118 | 2/19/2026 |
| 8.6.4 | 148 | 1/20/2026 |
| 8.6.3 | 128 | 1/17/2026 |
| 8.6.2 | 134 | 1/15/2026 |
| 8.6.1 | 135 | 1/12/2026 |
| 8.6.0 | 140 | 1/12/2026 |
| 8.5.9 | 377 | 12/23/2025 |
| 8.5.8 | 188 | 12/20/2025 |
| 8.5.7 | 283 | 12/19/2025 |
| 8.5.6 | 281 | 12/19/2025 |
| 8.5.4 | 286 | 8/17/2025 |
| 8.0.9 | 230 | 12/23/2024 |