This commit is contained in:
@@ -309,6 +309,8 @@ namespace AyaNova.Util
|
|||||||
internal static async Task EmptyBizDataFromDatabaseForSeedingOrImportingAsync(ILogger _log, Guid jobIdToKeep)
|
internal static async Task EmptyBizDataFromDatabaseForSeedingOrImportingAsync(ILogger _log, Guid jobIdToKeep)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
bool forSeeding = jobIdToKeep != Guid.Empty;
|
||||||
|
|
||||||
_log.LogInformation("Erasing Database \"{0}\"", _dbName);
|
_log.LogInformation("Erasing Database \"{0}\"", _dbName);
|
||||||
AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = (AyaNova.Api.ControllerHelpers.ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(AyaNova.Api.ControllerHelpers.ApiServerState));
|
AyaNova.Api.ControllerHelpers.ApiServerState apiServerState = (AyaNova.Api.ControllerHelpers.ApiServerState)ServiceProviderProvider.Provider.GetService(typeof(AyaNova.Api.ControllerHelpers.ApiServerState));
|
||||||
|
|
||||||
@@ -358,6 +360,11 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (forSeeding)
|
||||||
|
{
|
||||||
|
cmd.CommandText = "update aglobalbizsettings set taxpartpurchaseid=null,taxpartsaleid=null,taxratesaleid=null;";
|
||||||
|
await cmd.ExecuteNonQueryAsync();
|
||||||
|
}
|
||||||
//DELIBERATELY NOT ERASED:
|
//DELIBERATELY NOT ERASED:
|
||||||
//NOTE: these tables commented below are deliberately not affected as it's assumed for a **COMPLETE** erase users will erase manually or use the config setting to completely drop the database
|
//NOTE: these tables commented below are deliberately not affected as it's assumed for a **COMPLETE** erase users will erase manually or use the config setting to completely drop the database
|
||||||
//For anything less than that it's assumed users are testing things out and want to keep these tables but erase the biz data
|
//For anything less than that it's assumed users are testing things out and want to keep these tables but erase the biz data
|
||||||
@@ -486,7 +493,8 @@ namespace AyaNova.Util
|
|||||||
|
|
||||||
await EraseTableAsync("aservicerate", conn);
|
await EraseTableAsync("aservicerate", conn);
|
||||||
await EraseTableAsync("atravelrate", conn);
|
await EraseTableAsync("atravelrate", conn);
|
||||||
//await EraseTableAsync("ataxcode", conn);
|
if (forSeeding)
|
||||||
|
await EraseTableAsync("ataxcode", conn);
|
||||||
|
|
||||||
|
|
||||||
await EraseTableAsync("aquotestatus", conn);
|
await EraseTableAsync("aquotestatus", conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user