This commit is contained in:
2022-12-27 01:06:14 +00:00
parent c5d1350b6b
commit bf6554e568
4 changed files with 47 additions and 11 deletions

View File

@@ -1328,6 +1328,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
//Prime the db with the default SuperUser account
await Sockeye.Biz.PrimeData.PrimeSuperUserAccount(ct);
await Sockeye.Biz.PrimeData.PrimeVendor(ct);
}
}//eofunction

View File

@@ -354,7 +354,7 @@ namespace Sockeye.Util
}
/////////////////////////////////////////////////////////
@@ -394,14 +394,17 @@ namespace Sockeye.Util
cmd.Connection = conn;
cmd.CommandText = "update auser set customerid=null;";
await cmd.ExecuteNonQueryAsync();
cmd.CommandText = "update auser set headofficeid=null;";
await cmd.ExecuteNonQueryAsync();
cmd.CommandText = "update auser set vendorid=null;";
await cmd.ExecuteNonQueryAsync();
cmd.CommandText = "update alicense set customerid=null;";
await cmd.ExecuteNonQueryAsync();
//DELIBERATELY NOT ERASED:
@@ -450,7 +453,7 @@ namespace Sockeye.Util
//REMOVE ALL REMAINING DATA
await TruncateTableAsync("afileattachment", conn);
await TruncateTableAsync("aevent", conn);
await TruncateTableAsync("adatalistsavedfilter", conn);
@@ -462,10 +465,19 @@ namespace Sockeye.Util
await TruncateTableAsync("atag", conn);
await TruncateTableAsync("asubscriptionserver", conn);
await TruncateTableAsync("apurchase", conn);
await TruncateTableAsync("aproduct", conn);
//await TruncateTableAsync("avendor", conn);
await TruncateTableAsync("acustomernote", conn);
await TruncateTableAsync("acustomer", conn);
await TruncateTableAsync("aheadoffice", conn);
await TruncateTableAsync("agzcase", conn);
await TruncateTableAsync("atriallicenserequest", conn);
await TruncateTableAsync("alicense", conn);
//----- NOTIFICATION
await TruncateTableAsync("ainappnotification", conn);
await TruncateTableAsync("anotifyevent", conn);
@@ -518,7 +530,17 @@ namespace Sockeye.Util
}
//final housekeeping
using (var cmd = new Npgsql.NpgsqlCommand())
{
cmd.Connection = conn;
cmd.CommandText = $"ALTER SEQUENCE agzcase_caseid_seq RESTART WITH 2;";
await cmd.ExecuteNonQueryAsync();
}
await conn.CloseAsync();
}
@@ -584,9 +606,9 @@ namespace Sockeye.Util
//An empty db contains only one User
if (await ct.User.LongCountAsync() > 1) return false;
if (await ct.Customer.AnyAsync()) return false;
if (await ct.HeadOffice.AnyAsync()) return false;
return true;
}