Pure.RelationalSchema.Migration.Abstractions
0.1.0-preview.0.1.0
dotnet add package Pure.RelationalSchema.Migration.Abstractions --version 0.1.0-preview.0.1.0
NuGet\Install-Package Pure.RelationalSchema.Migration.Abstractions -Version 0.1.0-preview.0.1.0
<PackageReference Include="Pure.RelationalSchema.Migration.Abstractions" Version="0.1.0-preview.0.1.0" />
<PackageVersion Include="Pure.RelationalSchema.Migration.Abstractions" Version="0.1.0-preview.0.1.0" />
<PackageReference Include="Pure.RelationalSchema.Migration.Abstractions" />
paket add Pure.RelationalSchema.Migration.Abstractions --version 0.1.0-preview.0.1.0
#r "nuget: Pure.RelationalSchema.Migration.Abstractions, 0.1.0-preview.0.1.0"
#:package Pure.RelationalSchema.Migration.Abstractions@0.1.0-preview.0.1.0
#addin nuget:?package=Pure.RelationalSchema.Migration.Abstractions&version=0.1.0-preview.0.1.0&prerelease
#tool nuget:?package=Pure.RelationalSchema.Migration.Abstractions&version=0.1.0-preview.0.1.0&prerelease
Pure.RelationalSchema.Migration.Abstractions
Storage-agnostic schema migration abstractions for the Pure relational schema ecosystem — source-to-target mappings of schemas, tables and columns.
Overview
A schema migration takes the data stored for one version of a relational schema (the source) to a changed version of it (the target). Unchanged tables and columns map themselves. A renamed or reshaped table, or a renamed or retyped column, needs an explicit mapping to keep its data.
This package holds only the contracts that describe such a migration. It does not depend on any storage package, so a migration can be stored as data (for example as EF Core records in an AOT-compatible domain layer) and handed later to a storage-specific package that carries it out, such as Pure.RelationalSchema.Storage.PostgreSQL.Migration.
Public API
| Name | Namespace | Description |
|---|---|---|
IColumnMapping |
Pure.RelationalSchema.Migration.Abstractions.ColumnMapping |
IColumn Source and the IColumn Target that takes over its values |
ITableMapping |
Pure.RelationalSchema.Migration.Abstractions.TableMapping |
ITable Source, the ITable Target that takes over its rows, and the explicit IEnumerable<IColumnMapping> Columns between them |
ISchemaMigration |
Pure.RelationalSchema.Migration.Abstractions.SchemaMigration |
The whole migration as one value: ISchema Source, ISchema Target and the explicit IEnumerable<ITableMapping> Tables |
Columns and Tables hold the explicit mappings only. Consumers map unchanged tables and columns implicitly, so a migration that only adds or drops things can have no mappings at all. How the rest is matched, validated and applied is up to the consuming package.
Implementing the interfaces
The package ships no implementations: each consumer provides its own, as a plain record or as a persisted entity. A minimal set of records:
using Pure.RelationalSchema.Abstractions.Column;
using Pure.RelationalSchema.Abstractions.Schema;
using Pure.RelationalSchema.Abstractions.Table;
using Pure.RelationalSchema.Migration.Abstractions.ColumnMapping;
using Pure.RelationalSchema.Migration.Abstractions.SchemaMigration;
using Pure.RelationalSchema.Migration.Abstractions.TableMapping;
public sealed record ColumnMapping : IColumnMapping
{
public ColumnMapping(IColumn source, IColumn target)
{
Source = source;
Target = target;
}
public IColumn Source { get; }
public IColumn Target { get; }
}
public sealed record TableMapping : ITableMapping
{
public TableMapping(ITable source, ITable target, IEnumerable<IColumnMapping> columns)
{
Source = source;
Target = target;
Columns = columns;
}
public ITable Source { get; }
public ITable Target { get; }
public IEnumerable<IColumnMapping> Columns { get; }
}
public sealed record SchemaMigration : ISchemaMigration
{
public SchemaMigration(
ISchema source,
ISchema target,
IEnumerable<ITableMapping> tables
)
{
Source = source;
Target = target;
Tables = tables;
}
public ISchema Source { get; }
public ISchema Target { get; }
public IEnumerable<ITableMapping> Tables { get; }
}
Describing a migration in which column Name of table Products is renamed to Title:
ISchemaMigration migration = new SchemaMigration(
source,
target,
[new TableMapping(products, renamedProducts, [new ColumnMapping(name, title)])]
);
Design Principles
- Interfaces-only — no implementations, no tests; every file defines exactly one interface
- Storage-agnostic — depends on the relational schema model only, never on a storage package
- AOT-compatible —
IsAotCompatible=true - Documented — XML doc comments on every public member, shipped in the package
Dependencies
Pure.RelationalSchema.Abstractions—ISchema,ITable,IColumnand the other relational schema interfaces
Target Frameworks
- .NET 8
- .NET 9
- .NET 10
Installation
dotnet add package Pure.RelationalSchema.Migration.Abstractions
Related packages
Pure.RelationalSchema.Abstractions— the relational schema model the mappings refer toPure.RelationalSchema.Storage.PostgreSQL.Migration— carries the data stored in PostgreSQL over from the source schema to the target schema
| 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 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. |
-
net10.0
- Pure.RelationalSchema.Abstractions (>= 1.2.0)
-
net8.0
- Pure.RelationalSchema.Abstractions (>= 1.2.0)
-
net9.0
- Pure.RelationalSchema.Abstractions (>= 1.2.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Pure.RelationalSchema.Migration.Abstractions:
| Package | Downloads |
|---|---|
|
Pure.RelationalSchema.Storage.PostgreSQL.Migration
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.0.1.0 | 125 | 10/26/2026 |