case 4322

This commit is contained in:
2022-11-29 01:14:13 +00:00
parent a92327d7dc
commit 993117379d
2 changed files with 26 additions and 14 deletions

View File

@@ -867,16 +867,16 @@ namespace AyaNova.Biz
if (string.IsNullOrWhiteSpace(proposedObj.Name))
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
//If name is otherwise OK, check that name is unique
if (!PropertyHasErrors("Name"))
{
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
if (await ct.User.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
{
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
}
}
//case 4322 this is a problem with customer contacts and not really required anyway
// //If name is otherwise OK, check that name is unique
// if (!PropertyHasErrors("Name"))
// {
// //Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
// if (await ct.User.AnyAsync(z => z.Name == proposedObj.Name && z.Id != proposedObj.Id))
// {
// AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
// }
// }
//LOGIN must be unique
if (await ct.User.AnyAsync(z => z.Login == proposedObj.Login && z.Id != proposedObj.Id))

View File

@@ -20,10 +20,10 @@ namespace AyaNova.Util
/////////// CHANGE THIS ON NEW SCHEMA UPDATE ////////////////////
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
private const int DESIRED_SCHEMA_LEVEL = 12;
private const int DESIRED_SCHEMA_LEVEL = 13;
internal const long EXPECTED_COLUMN_COUNT = 1380;
internal const long EXPECTED_INDEX_COUNT = 161;
internal const long EXPECTED_INDEX_COUNT = 160;
internal const long EXPECTED_CHECK_CONSTRAINTS = 561;
internal const long EXPECTED_FOREIGN_KEY_CONSTRAINTS = 204;
internal const long EXPECTED_VIEWS = 11;
@@ -31,7 +31,7 @@ namespace AyaNova.Util
//!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!!
///////////////////////////////////////// C1380:I161:CC561:FC204:V11:R2)
/////////////////////////////////////////C1380:I160:CC561:FC204:V11:R2
/*
@@ -1685,7 +1685,7 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
await SetSchemaLevelAsync(++currentSchema);
}
//////////////////////////////////////////////////
//////////////////////////////////////////////////
//
// case 4173
//
@@ -1710,6 +1710,18 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist
//////////////////////////////////////////////////
//
// case 4322 User name uniqueness constraint problematic
//
if (currentSchema < 13)
{
LogUpdateMessage(log);
await ExecQueryAsync("ALTER TABLE auser DROP CONSTRAINT auser_name_key;");
await SetSchemaLevelAsync(++currentSchema);
}
//#########################################