Pure.RelationalSchema.Migration.Abstractions 0.1.0-preview.0.1.0

This is a prerelease version of Pure.RelationalSchema.Migration.Abstractions.
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
                    
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="Pure.RelationalSchema.Migration.Abstractions" Version="0.1.0-preview.0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pure.RelationalSchema.Migration.Abstractions" Version="0.1.0-preview.0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Pure.RelationalSchema.Migration.Abstractions" />
                    
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 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"
                    
#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 Pure.RelationalSchema.Migration.Abstractions@0.1.0-preview.0.1.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=Pure.RelationalSchema.Migration.Abstractions&version=0.1.0-preview.0.1.0&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Pure.RelationalSchema.Migration.Abstractions&version=0.1.0-preview.0.1.0&prerelease
                    
Install as a Cake Tool

Pure.RelationalSchema.Migration.Abstractions

Storage-agnostic schema migration abstractions for the Pure relational schema ecosystem — source-to-target mappings of schemas, tables and columns.

.NET build & check Build and Deploy NuGet License: MIT

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

Target Frameworks

  • .NET 8
  • .NET 9
  • .NET 10

Installation

dotnet add package Pure.RelationalSchema.Migration.Abstractions
  • Pure.RelationalSchema.Abstractions — the relational schema model the mappings refer to
  • Pure.RelationalSchema.Storage.PostgreSQL.Migration — carries the data stored in PostgreSQL over from the source schema to the target schema
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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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