MintPlayer.Spark.Migrations 10.0.0-preview.39

This is a prerelease version of MintPlayer.Spark.Migrations.
dotnet add package MintPlayer.Spark.Migrations --version 10.0.0-preview.39
                    
NuGet\Install-Package MintPlayer.Spark.Migrations -Version 10.0.0-preview.39
                    
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="MintPlayer.Spark.Migrations" Version="10.0.0-preview.39" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MintPlayer.Spark.Migrations" Version="10.0.0-preview.39" />
                    
Directory.Packages.props
<PackageReference Include="MintPlayer.Spark.Migrations" />
                    
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 MintPlayer.Spark.Migrations --version 10.0.0-preview.39
                    
#r "nuget: MintPlayer.Spark.Migrations, 10.0.0-preview.39"
                    
#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 MintPlayer.Spark.Migrations@10.0.0-preview.39
                    
#: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=MintPlayer.Spark.Migrations&version=10.0.0-preview.39&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=MintPlayer.Spark.Migrations&version=10.0.0-preview.39&prerelease
                    
Install as a Cake Tool

MintPlayer.Spark.Migrations

One-time database migrations for MintPlayer.Spark.

Define a migration by implementing ISparkMigration on a non-abstract class and giving it a static abstract long Version. Migrations run once, in version order, at startup — after indexes are created and before the app serves requests.

using MintPlayer.Spark.Migrations;
using Raven.Client.Documents.Session;

public partial class M_202606081200_SeedDemo : ISparkMigration
{
    public static long Version => 202606081200;          // sortable timestamp; must be unique
    public static string? Description => "Seed demo data";

    [Inject] private readonly IAsyncDocumentSession session;   // full scoped DI, like a cron job

    public async Task UpAsync(CancellationToken cancellationToken)
    {
        await session.StoreAsync(new Company { Name = "Acme" }, cancellationToken);
        await session.SaveChangesAsync(cancellationToken);
    }
}

Enable it — the source generator discovers every ISparkMigration and emits AddMigrations():

builder.Services.AddSpark(builder.Configuration, spark =>
{
    spark.UseContext<MyContext>();
    spark.AddMigrations();   // generated; auto-discovers all migrations in this project
});

Or register manually:

spark.AddMigrations(m => m.AddMigration<M_202606081200_SeedDemo>());

Guarantees

  • Run-once per database — each applied version writes a SparkMigrationRecords/{version} marker document; a migration whose marker exists is skipped.
  • Ordered — migrations run ascending by Version.
  • Multi-node safe — a cluster-wide RavenDB compare-exchange lock (spark/migrations/lock, 30-minute lease) ensures only one node applies migrations at a time.
  • Fail-fast — a migration that throws aborts startup and is left unmarked, so it retries on the next start. Call SaveChangesAsync yourself; the version marker is written only after UpAsync returns successfully.

Forward-only (no Down) by design — migrations describe how the data moves forward.

Product Compatible and additional computed target framework versions.
.NET 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 MintPlayer.Spark.Migrations:

Package Downloads
MintPlayer.Spark.AllFeatures

All-in-one package for MintPlayer.Spark. References all Spark libraries and source-generates AddSparkFull/UseSparkFull/MapSparkFull convenience methods.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.0-preview.39 40 6/9/2026
10.0.0-preview.38 38 6/9/2026
10.0.0-preview.37 51 6/8/2026