This commit is contained in:
2020-06-18 21:31:44 +00:00
parent e192ca042b
commit 40b705b75a
7 changed files with 44 additions and 8 deletions

View File

@@ -22,7 +22,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 11;
internal const long EXPECTED_COLUMN_COUNT = 324;
internal const long EXPECTED_COLUMN_COUNT = 325;
internal const long EXPECTED_INDEX_COUNT = 134;
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImporting WHEN NEW TABLES ADDED!!!!
@@ -325,7 +325,7 @@ $BODY$;
//Add user table
await ExecQueryAsync("CREATE TABLE auser (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active bool not null, name varchar(255) not null unique, " +
"login text not null unique, password text not null, salt text not null, roles integer not null, currentauthtoken text, " +
"lastlogin timestamp, login text not null unique, password text not null, salt text not null, roles integer not null, currentauthtoken text, " +
"dlkey text, dlkeyexpire timestamp, usertype integer not null, employeenumber varchar(255), notes text, customerid bigint, " +
"headofficeid bigint, subvendorid bigint, wiki text null, customfields text, tags varchar(255) ARRAY)");

View File

@@ -707,6 +707,9 @@ namespace AyaNova.Core
//TODO: TECHCOUNT - new license causes exceeding count?
if (await AyaNova.Biz.UserBiz.ActiveCountAsync() > ParsedNewKey.GetLicenseFeature(SERVICE_TECHS_FEATURE_NAME).Count)
{
//Ok, the easy thing to do here is just set all techs inactive, but
//a trickier but probably better thing to do is set just enough techs inactive and choose them based
//on the oldest last login datetime first
throw new ApplicationException("E1020 - Can't install key, too many active techs and / or subcontractors in database. Deactivate enough to install key.");
}