From 993117379dbb174be52c0586ab2ddc4a67b79add Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 29 Nov 2022 01:14:13 +0000 Subject: [PATCH] case 4322 --- server/AyaNova/biz/UserBiz.cs | 20 ++++++++++---------- server/AyaNova/util/AySchema.cs | 20 ++++++++++++++++---- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/server/AyaNova/biz/UserBiz.cs b/server/AyaNova/biz/UserBiz.cs index 7f392993..be60b25e 100644 --- a/server/AyaNova/biz/UserBiz.cs +++ b/server/AyaNova/biz/UserBiz.cs @@ -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)) diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index cedcd25a..129bbc59 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -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); + + } + //#########################################