cli: populate migration module registry and tests

This commit is contained in:
StellaOps Bot
2025-12-06 16:14:49 +00:00
parent 868f8e0bb6
commit 849a70f9d1
2 changed files with 58 additions and 19 deletions

View File

@@ -1,4 +1,10 @@
using System.Reflection;
using StellaOps.Authority.Storage.Postgres;
using StellaOps.Concelier.Storage.Postgres;
using StellaOps.Excititor.Storage.Postgres;
using StellaOps.Notify.Storage.Postgres;
using StellaOps.Policy.Storage.Postgres;
using StellaOps.Scheduler.Storage.Postgres;
namespace StellaOps.Cli.Services;
@@ -17,15 +23,39 @@ public sealed record MigrationModuleInfo(
/// </summary>
public static class MigrationModuleRegistry
{
// TODO: Wire actual module assemblies when Storage.Postgres projects are implemented
// Modules will be registered as:
// - Authority (auth schema) - StellaOps.Authority.Storage.Postgres.AuthorityDataSource
// - Scheduler (scheduler schema) - StellaOps.Scheduler.Storage.Postgres.SchedulerDataSource
// - Concelier (vuln schema) - StellaOps.Concelier.Storage.Postgres.ConcelierDataSource
// - Policy (policy schema) - StellaOps.Policy.Storage.Postgres.PolicyDataSource
// - Notify (notify schema) - StellaOps.Notify.Storage.Postgres.NotifyDataSource
// - Excititor (vex schema) - StellaOps.Excititor.Storage.Postgres.ExcititorDataSource
private static readonly List<MigrationModuleInfo> _modules = [];
private static readonly List<MigrationModuleInfo> _modules =
[
new(
Name: "Authority",
SchemaName: "authority",
MigrationsAssembly: typeof(AuthorityDataSource).Assembly,
ResourcePrefix: "StellaOps.Authority.Storage.Postgres.Migrations"),
new(
Name: "Scheduler",
SchemaName: "scheduler",
MigrationsAssembly: typeof(SchedulerDataSource).Assembly,
ResourcePrefix: "StellaOps.Scheduler.Storage.Postgres.Migrations"),
new(
Name: "Concelier",
SchemaName: "vuln",
MigrationsAssembly: typeof(ConcelierDataSource).Assembly,
ResourcePrefix: "StellaOps.Concelier.Storage.Postgres.Migrations"),
new(
Name: "Policy",
SchemaName: "policy",
MigrationsAssembly: typeof(PolicyDataSource).Assembly,
ResourcePrefix: "StellaOps.Policy.Storage.Postgres.Migrations"),
new(
Name: "Notify",
SchemaName: "notify",
MigrationsAssembly: typeof(NotifyDataSource).Assembly,
ResourcePrefix: "StellaOps.Notify.Storage.Postgres.Migrations"),
new(
Name: "Excititor",
SchemaName: "vex",
MigrationsAssembly: typeof(ExcititorDataSource).Assembly,
ResourcePrefix: "StellaOps.Excititor.Storage.Postgres.Migrations"),
];
/// <summary>
/// Gets all registered modules.