From f3550d19d84dab4f40eb40e682bbe20e6ecddd60 Mon Sep 17 00:00:00 2001 From: Aleksandar Toplek Date: Fri, 12 Jan 2024 21:05:19 +0100 Subject: [PATCH] feat(cloud): Migration table create for PATs --- .../MigrationFunction.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cloud/src/Signalco.Func.Internal.Migration/MigrationFunction.cs b/cloud/src/Signalco.Func.Internal.Migration/MigrationFunction.cs index ddff569da6..7467aee21e 100644 --- a/cloud/src/Signalco.Func.Internal.Migration/MigrationFunction.cs +++ b/cloud/src/Signalco.Func.Internal.Migration/MigrationFunction.cs @@ -12,12 +12,13 @@ public class MigrationFunction( IAzureStorage azureStorage) { private const string CronOnceAYear = "0 0 0 1 1 *"; - - private readonly string[] tablesNames = { + + private readonly string[] tablesNames = { "entities", "contacts", "contactshistory", "userassignedentity", + "pats", "users", "webnewsletter", - "contactLinks" + "contactLinks" }; private readonly string[] queueNames = { "contact-state-processing", "usage-processing" @@ -28,12 +29,12 @@ public async Task Run( [TimerTrigger(CronOnceAYear, RunOnStartup = true)] TimerInfo timer, CancellationToken cancellationToken = default) { - foreach (var tableName in tablesNames) + foreach (var tableName in tablesNames) await azureStorage.EnsureTableAsync(tableName, cancellationToken); - - foreach (var queueName in queueNames) + + foreach (var queueName in queueNames) await azureStorage.EnsureQueueAsync(queueName, cancellationToken); - + // Create Public Channel Entity Time if doesn't exist if (!await dao.EntityExistsAsync(KnownEntities.Time.EntityId, cancellationToken)) await entityService.UpsertAsync(