Skip to content

Commit

Permalink
feat(cloud): Migration table create for PATs
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandarDev committed Jan 12, 2024
1 parent 151990f commit f3550d1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cloud/src/Signalco.Func.Internal.Migration/MigrationFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand Down

0 comments on commit f3550d1

Please sign in to comment.