This commit is contained in:
2022-03-11 00:44:39 +00:00
parent 7a246dfdcf
commit f11c06cf19
2 changed files with 4 additions and 4 deletions

View File

@@ -265,7 +265,7 @@ namespace AyaNova.Api.Controllers
//empty the db
await AyaNova.Util.DbUtil.EmptyBizDataFromDatabaseForSeedingOrImportingAsync(log, Guid.Empty);
await AyaNova.Util.DbUtil.EmptyBizDataFromDatabaseForSeedingOrImportingAsync(log, Guid.Empty, serverState.IsMigrateMode);
//Log
await EventLogProcessor.LogEventToDatabaseAsync(new Event(1, 0, AyaType.Global, AyaEvent.EraseAllData), ct);

View File

@@ -306,7 +306,7 @@ namespace AyaNova.Util
// Erase all user entered data from the db
// This is called by seeder for trial seeding purposes
// and by v8 migrate and by license controller when erasing db
internal static async Task EmptyBizDataFromDatabaseForSeedingOrImportingAsync(ILogger _log, Guid jobIdToKeep)
internal static async Task EmptyBizDataFromDatabaseForSeedingOrImportingAsync(ILogger _log, Guid jobIdToKeep, bool isMigrate=false)
{
bool forSeeding = jobIdToKeep != Guid.Empty;
@@ -360,7 +360,7 @@ namespace AyaNova.Util
}
if (forSeeding)
if (forSeeding || isMigrate)
{
cmd.CommandText = "update aglobalbizsettings set taxpartpurchaseid=null,taxpartsaleid=null,taxratesaleid=null;";
await cmd.ExecuteNonQueryAsync();
@@ -493,7 +493,7 @@ namespace AyaNova.Util
await EraseTableAsync("aservicerate", conn);
await EraseTableAsync("atravelrate", conn);
if (forSeeding)
if (forSeeding || isMigrate)
await EraseTableAsync("ataxcode", conn);