MintPlayer.Spark.Migrations
10.0.0-preview.64
dotnet add package MintPlayer.Spark.Migrations --version 10.0.0-preview.64
NuGet\Install-Package MintPlayer.Spark.Migrations -Version 10.0.0-preview.64
<PackageReference Include="MintPlayer.Spark.Migrations" Version="10.0.0-preview.64" />
<PackageVersion Include="MintPlayer.Spark.Migrations" Version="10.0.0-preview.64" />
<PackageReference Include="MintPlayer.Spark.Migrations" />
paket add MintPlayer.Spark.Migrations --version 10.0.0-preview.64
#r "nuget: MintPlayer.Spark.Migrations, 10.0.0-preview.64"
#:package MintPlayer.Spark.Migrations@10.0.0-preview.64
#addin nuget:?package=MintPlayer.Spark.Migrations&version=10.0.0-preview.64&prerelease
#tool nuget:?package=MintPlayer.Spark.Migrations&version=10.0.0-preview.64&prerelease
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
SaveChangesAsyncyourself; the version marker is written only afterUpAsyncreturns successfully.
Forward-only (no Down) by design — migrations describe how the data moves forward.
| Product | Versions 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. |
-
net10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.11)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.11)
- MintPlayer.SourceGenerators.Attributes (>= 10.20.0)
- MintPlayer.Spark.Abstractions (>= 10.0.0-preview.64)
- RavenDB.Client (>= 7.2.5)
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.64 | 44 | 8/24/2026 |
| 10.0.0-preview.63 | 53 | 8/23/2026 |
| 10.0.0-preview.62 | 47 | 8/23/2026 |
| 10.0.0-preview.60 | 52 | 8/21/2026 |
| 10.0.0-preview.59 | 71 | 8/21/2026 |
| 10.0.0-preview.58 | 50 | 8/21/2026 |
| 10.0.0-preview.57 | 67 | 8/20/2026 |
| 10.0.0-preview.56 | 51 | 8/20/2026 |
| 10.0.0-preview.55 | 62 | 8/19/2026 |
| 10.0.0-preview.54 | 58 | 8/19/2026 |
| 10.0.0-preview.53 | 75 | 8/18/2026 |
| 10.0.0-preview.52 | 72 | 8/18/2026 |
| 10.0.0-preview.51 | 76 | 8/16/2026 |
| 10.0.0-preview.49 | 61 | 8/16/2026 |
| 10.0.0-preview.48 | 56 | 8/16/2026 |
| 10.0.0-preview.47 | 55 | 8/16/2026 |
| 10.0.0-preview.46 | 52 | 8/15/2026 |
| 10.0.0-preview.45 | 58 | 8/15/2026 |
| 10.0.0-preview.44 | 60 | 8/14/2026 |
| 10.0.0-preview.43 | 60 | 8/14/2026 |