Skip to content

Commit

Permalink
Undo exchangeFile changes, only kept sql query quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoineatstariongroup committed Jan 21, 2025
1 parent 85d4a66 commit 3ba3360
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ namespace CometServer.Modules
using CDP4Orm.Dao;
using CDP4Orm.MigrationEngine;

using CometServer.Authentication.Anonymous;
using CometServer.Configuration;
using CometServer.Extensions;
using CometServer.Health;
Expand All @@ -61,13 +60,11 @@ namespace CometServer.Modules
using Microsoft.Extensions.Logging;

using Npgsql;

using NpgsqlTypes;


/// <summary>
/// This is an API endpoint class to support the ECSS-E-TM-10-25-AnnexC exchange file format import
/// </summary>
public class ExchangeFileImportApi : CarterModule
public class ExchangeFileImportyApi : CarterModule
{
/// <summary>
/// The top container.
Expand All @@ -83,7 +80,7 @@ public class ExchangeFileImportApi : CarterModule
/// <summary>
/// The (injected) <see cref="ILogger{ExchangeFileImportyApi}"/>
/// </summary>
private readonly ILogger<ExchangeFileImportApi> logger;
private readonly ILogger<ExchangeFileImportyApi> logger;

/// <summary>
/// The (injected) <see cref="IAppConfigService"/>
Expand All @@ -101,7 +98,7 @@ public class ExchangeFileImportApi : CarterModule
private readonly ITokenGeneratorService tokenGeneratorService;

/// <summary>
/// Initializes a new instance of the <see cref="ExchangeFileImportApi"/>
/// Initializes a new instance of the <see cref="ExchangeFileImportyApi"/>
/// </summary>
/// <param name="appConfigService">
/// The (injected) <see cref="IAppConfigService"/>
Expand All @@ -115,7 +112,7 @@ public class ExchangeFileImportApi : CarterModule
/// <param name="logger">
/// The (injected) <see cref="ILogger{ExchangeFileImportyApi}"/>
/// </param>
public ExchangeFileImportApi(IAppConfigService appConfigService, ICometHasStartedService cometHasStartedService, ITokenGeneratorService tokenGeneratorService, ILogger<ExchangeFileImportApi> logger)
public ExchangeFileImportyApi(IAppConfigService appConfigService, ICometHasStartedService cometHasStartedService, ITokenGeneratorService tokenGeneratorService, ILogger<ExchangeFileImportyApi> logger)
{
this.appConfigService = appConfigService;
this.cometHasStartedService = cometHasStartedService;
Expand Down Expand Up @@ -1098,6 +1095,7 @@ private void DropDataStoreAndPrepareNew(IDataStoreController dataStoreController
this.logger.LogDebug("Drop the restore data store");

cmd.Connection = connection;

cmd.CommandText = $"DROP DATABASE IF EXISTS \"{backtierConfig.DatabaseRestore}\";";

cmd.ExecuteNonQuery();
Expand All @@ -1108,9 +1106,9 @@ private void DropDataStoreAndPrepareNew(IDataStoreController dataStoreController
{
this.logger.LogDebug("Create the data store");
cmd.Connection = connection;
// Create DATABASE command does not support parameters statements
cmd.CommandText = $"CREATE DATABASE \"{backtierConfig.Database}\" WITH OWNER = \"{backtierConfig.UserName}\" TEMPLATE = \"{backtierConfig.DatabaseManage}\" ENCODING = UTF8;";

cmd.CommandText = $"CREATE DATABASE \"{backtierConfig.Database}\" WITH OWNER = \"{backtierConfig.UserName}\" TEMPLATE = \"{backtierConfig.DatabaseManage}\" ENCODING = 'UTF8';";

cmd.ExecuteNonQuery();
}

Expand Down Expand Up @@ -1430,4 +1428,4 @@ private void FindAndCreateMissingPersonPermissions(IPersonPermissionService pers
}
}
}
}
}

0 comments on commit 3ba3360

Please sign in to comment.