Sintia.AuthServer.Migration 1.2.5

dotnet add package Sintia.AuthServer.Migration --version 1.2.5
                    
NuGet\Install-Package Sintia.AuthServer.Migration -Version 1.2.5
                    
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="Sintia.AuthServer.Migration" Version="1.2.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sintia.AuthServer.Migration" Version="1.2.5" />
                    
Directory.Packages.props
<PackageReference Include="Sintia.AuthServer.Migration" />
                    
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 Sintia.AuthServer.Migration --version 1.2.5
                    
#r "nuget: Sintia.AuthServer.Migration, 1.2.5"
                    
#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 Sintia.AuthServer.Migration@1.2.5
                    
#: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=Sintia.AuthServer.Migration&version=1.2.5
                    
Install as a Cake Addin
#tool nuget:?package=Sintia.AuthServer.Migration&version=1.2.5
                    
Install as a Cake Tool

Sintia.AuthServer.Migration

Cos'è

Le migration EF Core (SQL Server e PostgreSql) di Sintia.AuthServer e il servizio che le applica, AuthServerDbMigrationService. Il pacchetto si referenzia solo dal DbMigrator, l'applicazione console che crea e aggiorna lo schema nel passo di deploy. L'Host referenzia soltanto Sintia.AuthServer.

Il pacchetto dipende da Sintia.AuthServer: ABP, EF Core e i pin Microsoft.IdentityModel.* arrivano da lì, senza duplicazioni.

Uso nel DbMigrator

using Sintia.AuthServer.Migrations.Package;

[DependsOn(
    typeof(AbpAutofacModule),
    typeof(SintiaAuthServerMigrationModule))]
public class MioDbMigratorModule : AbpModule
{
}

Dopo application.InitializeAsync() si chiama il servizio di migrazione:

await application.ServiceProvider
    .GetRequiredService<AuthServerDbMigrationService>()
    .MigrateAsync();

Configurazione richiesta (chiavi, senza valori in repo):

  • DatabaseProvider: SqlServer oppure PostgreSql
  • ConnectionStrings:Default: connection string del database dell'AuthServer

Per PostgreSql lo switch Npgsql.EnableLegacyTimestampBehavior è impostato dal modulo: il DbMigrator non deve ricordarsene.

Vincolo: niente host web

Il pacchetto include build/Sintia.AuthServer.Migration.targets. Un progetto Microsoft.NET.Sdk.Web che referenzia il pacchetto fallisce in compilazione con l'errore SINTIAMIG001: le migration non devono girare all'avvio dell'Host (migrazioni concorrenti tra istanze, codice che altera lo schema in produzione).

Per disattivare il controllo, consapevolmente, impostare la proprietà MSBuild SintiaAuthServerMigrationAllowWeb a true.

Limiti noti:

  • vale solo per i riferimenti diretti al pacchetto (cartella build/, non buildTransitive/);
  • non ferma un progetto Worker o una console che ospita un server web;
  • è una protezione da errori, non una barriera di sicurezza.

Host: controllo dello schema

L'Host non applica mai migration. All'avvio, Sintia.AuthServer confronta il database con il modello EF e fallisce con un errore esplicito se il database non è raggiungibile o se mancano tabelle o colonne. Il controllo è sempre attivo e non configurabile.

Lo stesso controllo è esposto come health check sintia-authserver-db-schema con tag ready. Ogni Host mappa /health/ready filtrando sul tag ready: il pacchetto non mappa l'endpoint da sé.

Breaking change

Dalle versioni che includono questo pacchetto le migration non sono più dentro Sintia.AuthServer. Un DbMigrator che aggiorna solo Sintia.AuthServer non crea né aggiorna le tabelle, e l'Host lo segnala all'avvio con il controllo dello schema. Aggiungere Sintia.AuthServer.Migration al DbMigrator e rilasciarlo prima dell'Host.

Sicurezza

Il seed iniziale crea l'utente amministratore con le credenziali di default di ABP. Cambiarle subito dopo la prima esecuzione del DbMigrator. La gestione delle credenziali da configurazione arriverà con SEED-01.

Il pacchetto non contiene configurazione, certificati né segreti.

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

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
1.2.5 83 10/26/2026
1.2.3 80 10/16/2026
1.2.2 96 10/15/2026