This commit is contained in:
@@ -314,7 +314,7 @@ namespace AyaNova.Util
|
|||||||
await EraseTableAsync("aformcustom", conn);
|
await EraseTableAsync("aformcustom", conn);
|
||||||
await EraseTableAsync("asearchkey", conn);
|
await EraseTableAsync("asearchkey", conn);
|
||||||
await EraseTableAsync("asearchdictionary", conn);
|
await EraseTableAsync("asearchdictionary", conn);
|
||||||
await EraseTableAsync("atag", conn);
|
await EraseTableAsync("atag", conn);
|
||||||
await EraseTableAsync("acustomer", conn);
|
await EraseTableAsync("acustomer", conn);
|
||||||
await EraseTableAsync("acontract", conn);
|
await EraseTableAsync("acontract", conn);
|
||||||
await EraseTableAsync("aheadoffice", conn);
|
await EraseTableAsync("aheadoffice", conn);
|
||||||
@@ -377,27 +377,15 @@ namespace AyaNova.Util
|
|||||||
// CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check
|
// CALLED BY LICENSE CONTROLLER AND LICENSE.CS FOR TRIAL Request check
|
||||||
internal static async Task<bool> DBIsEmptyAsync(AyContext ct, ILogger _log)
|
internal static async Task<bool> DBIsEmptyAsync(AyContext ct, ILogger _log)
|
||||||
{
|
{
|
||||||
//TODO: This needs to be way more thorough, only the main tables though, no need to get crazy with it
|
//For efficiency just check a few main tables just stuff that would be shitty to have to re-enter
|
||||||
//just stuff that would be shitty to have to re-enter
|
//Mostly user, customer and vendor cover it because nearly everything else requires those to have any sort of data at all
|
||||||
|
|
||||||
_log.LogDebug("DB empty check");
|
_log.LogDebug("DB empty check");
|
||||||
|
|
||||||
//An empty db contains only one User
|
//An empty db contains only one User
|
||||||
if (await ct.User.LongCountAsync() > 1) return false;
|
if (await ct.User.LongCountAsync() > 1) return false;
|
||||||
|
if (await ct.Customer.AnyAsync()) return false;
|
||||||
|
if (await ct.Vendor.AnyAsync()) return false;
|
||||||
//No clients
|
|
||||||
//if(ctx.Client.Count()>0) return false;
|
|
||||||
|
|
||||||
//No units
|
|
||||||
//if(ctx.Unit.Count()>0) return false;
|
|
||||||
|
|
||||||
//No parts
|
|
||||||
//if(ctx.Part.Count()>0) return false;
|
|
||||||
|
|
||||||
//No workorders
|
|
||||||
//if(ctx.Workorder.Count()>0) return false;
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user