fix(jobengine): register startup migrations for orchestrator schema
Wire AddStartupMigrations so JobEngine converges the orchestrator schema on fresh database or wiped volumes without manual bootstrap scripts. Adds StellaOps.Infrastructure.Postgres.Migrations dependency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Npgsql;
|
||||
using StellaOps.Infrastructure.Postgres.Migrations;
|
||||
using StellaOps.JobEngine.Core.Backfill;
|
||||
using StellaOps.JobEngine.Core.DeadLetter;
|
||||
using StellaOps.JobEngine.Core.Observability;
|
||||
@@ -54,6 +55,12 @@ public static class ServiceCollectionExtensions
|
||||
}
|
||||
});
|
||||
|
||||
services.AddStartupMigrations<JobEngineServiceOptions>(
|
||||
schemaName: "orchestrator",
|
||||
moduleName: "JobEngine",
|
||||
migrationsAssembly: typeof(JobEngineDataSource).Assembly,
|
||||
connectionStringSelector: options => options.Database.ConnectionString);
|
||||
|
||||
// Register data source
|
||||
services.AddSingleton<JobEngineDataSource>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user