From 146e2e80f3d93df24a2139f0dfdbc2a8b8e24835 Mon Sep 17 00:00:00 2001 From: Martin Benjamins Date: Sun, 24 Nov 2024 21:25:55 +0100 Subject: [PATCH] Add check for impossible noninline relation arrays --- code/C#/DBDefsValidator/Program.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/code/C#/DBDefsValidator/Program.cs b/code/C#/DBDefsValidator/Program.cs index e1d9f0bc75c..942d372e650 100644 --- a/code/C#/DBDefsValidator/Program.cs +++ b/code/C#/DBDefsValidator/Program.cs @@ -91,6 +91,20 @@ static void Main(string[] args) Console.ResetColor(); } } + + foreach (var versionDefinition in definition.Value.versionDefinitions) + { + foreach (var column in versionDefinition.definitions) + { + if (column.isRelation && column.isNonInline && column.arrLength > 1) + { + errorEncountered.Add(definition.Key); + Console.ForegroundColor = ConsoleColor.Red; + Console.WriteLine(definition.Key + "." + column.name + " is a non-inline relation with an array length greater than 1 (" + column.arrLength + ")!"); + Console.ResetColor(); + } + } + } } Console.WriteLine("Checked " + foreignKeys + " foreign keys!"); @@ -179,6 +193,7 @@ static void Main(string[] args) Console.WriteLine("There have been errors in the following DBDs:"); foreach (var dbName in errorEncountered) Console.WriteLine(" - " + dbName); + Console.ResetColor(); Environment.Exit(1); } else