This commit is contained in:
Janus Knudsen 2025-02-13 17:06:22 +01:00
parent 7bcb7b0e66
commit e777135d62
2 changed files with 92 additions and 50 deletions

View file

@ -1,6 +1,7 @@
using Autofac;
using Insight.Database;
using System.Data;
using System.Diagnostics;
namespace SetupInfrastructure
{
@ -46,17 +47,34 @@ namespace SetupInfrastructure
if (IsSuperAdmin())
{
Console.ForegroundColor = ConsoleColor.Green;
var sw = new Stopwatch();
Console.Write("Database.Core.DCL.SetupApplicationUser...");
sw.Start();
var setupApplicationUser = _container.Resolve<Database.Core.DCL.SetupApplicationUser>();
setupApplicationUser.With(new Database.Core.DCL.SetupApplicationUser.Command { Password = "3911", Schema = "system", User = "sathumper" });
Console.WriteLine("Database.Core.DCL.SetupApplicationUser done!");
Console.WriteLine();
Console.Write($"DONE, took: {sw.ElapsedMilliseconds} ms");
Console.WriteLine("::");
Console.WriteLine("::");
Console.Write("Database.Core.DDL.SetupIdentitySystem...");
sw.Restart();
//create new container with application user, we use that role from now.
_container = new Startup().ConfigureContainer(new Startup.ConnectionStringTemplateParameters("sathumper", "3911"));
var setupIdentitySystem = _container.Resolve<Database.Core.DDL.SetupIdentitySystem>();
setupIdentitySystem.With(new Database.Core.DDL.SetupIdentitySystem.Command());
// SetupIdentitySystem
Console.Write($"DONE, took: {sw.ElapsedMilliseconds} ms");
Console.WriteLine("::");
Console.WriteLine("::");
Console.Write("Database.Core.DDL.SetupIdentitySystem...");
sw.Restart();
var setupConfigurationSystem = _container.Resolve<Database.ConfigurationManagementSystem.SetupConfiguration>();
setupConfigurationSystem.With(new Database.ConfigurationManagementSystem.SetupConfiguration.Command());
Console.Write($"DONE, took: {sw.ElapsedMilliseconds} ms");
// SetupConfiguration